[UUID] Reimplement comparison operators more canonically. NFCI.

llvm-svn: 312457
This commit is contained in:
Davide Italiano
2017-09-03 20:53:24 +00:00
parent d6e0679c4e
commit d8f067539b

View File

@@ -198,8 +198,7 @@ bool lldb_private::operator==(const lldb_private::UUID &lhs,
bool lldb_private::operator!=(const lldb_private::UUID &lhs,
const lldb_private::UUID &rhs) {
return ::memcmp(lhs.GetBytes(), rhs.GetBytes(),
sizeof(lldb_private::UUID::ValueType)) != 0;
return !(lhs == rhs);
}
bool lldb_private::operator<(const lldb_private::UUID &lhs,
@@ -210,18 +209,15 @@ bool lldb_private::operator<(const lldb_private::UUID &lhs,
bool lldb_private::operator<=(const lldb_private::UUID &lhs,
const lldb_private::UUID &rhs) {
return ::memcmp(lhs.GetBytes(), rhs.GetBytes(),
sizeof(lldb_private::UUID::ValueType)) <= 0;
return !(lhs > rhs);
}
bool lldb_private::operator>(const lldb_private::UUID &lhs,
const lldb_private::UUID &rhs) {
return ::memcmp(lhs.GetBytes(), rhs.GetBytes(),
sizeof(lldb_private::UUID::ValueType)) > 0;
return rhs < lhs;
}
bool lldb_private::operator>=(const lldb_private::UUID &lhs,
const lldb_private::UUID &rhs) {
return ::memcmp(lhs.GetBytes(), rhs.GetBytes(),
sizeof(lldb_private::UUID::ValueType)) >= 0;
return !(lhs < rhs);
}