diff options
| author | Davide Italiano <davide@freebsd.org> | 2017-09-03 20:53:24 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2017-09-03 20:53:24 +0000 |
| commit | d8f067539b5733a9dbddeb8dc2e488aee76f1aa6 (patch) | |
| tree | 2303d0d04f57c2ca70f30d81b552e32a3a921b1a | |
| parent | d6e0679c4e3a82a8228b17af43f020e017bf3b4c (diff) | |
| download | bcm5719-llvm-d8f067539b5733a9dbddeb8dc2e488aee76f1aa6.tar.gz bcm5719-llvm-d8f067539b5733a9dbddeb8dc2e488aee76f1aa6.zip | |
[UUID] Reimplement comparison operators more canonically. NFCI.
llvm-svn: 312457
| -rw-r--r-- | lldb/source/Utility/UUID.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Utility/UUID.cpp b/lldb/source/Utility/UUID.cpp index b47f8b52f1c..edad98e2f20 100644 --- a/lldb/source/Utility/UUID.cpp +++ b/lldb/source/Utility/UUID.cpp @@ -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); } |

