From db057e779221b12d38104f3056c31914ff90be23 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sat, 29 Dec 2018 05:05:23 +0000 Subject: [PATCH] [RegisterValue] Rewrite operator!= in terms of operator==. NFCI. llvm-svn: 350149 --- lldb/source/Utility/RegisterValue.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/lldb/source/Utility/RegisterValue.cpp b/lldb/source/Utility/RegisterValue.cpp index 0abe92ec02ca..27bffde637fb 100644 --- a/lldb/source/Utility/RegisterValue.cpp +++ b/lldb/source/Utility/RegisterValue.cpp @@ -793,32 +793,7 @@ bool RegisterValue::operator==(const RegisterValue &rhs) const { } bool RegisterValue::operator!=(const RegisterValue &rhs) const { - if (m_type != rhs.m_type) - return true; - switch (m_type) { - case eTypeInvalid: - return false; - case eTypeUInt8: - case eTypeUInt16: - case eTypeUInt32: - case eTypeUInt64: - case eTypeUInt128: - case eTypeFloat: - case eTypeDouble: - case eTypeLongDouble: - return m_scalar != rhs.m_scalar; - case eTypeBytes: - if (buffer.length != rhs.buffer.length) { - return true; - } else { - uint8_t length = buffer.length; - if (length > kMaxRegisterByteSize) - length = kMaxRegisterByteSize; - return memcmp(buffer.bytes, rhs.buffer.bytes, length) != 0; - } - break; - } - return true; + return !(*this == rhs); } bool RegisterValue::ClearBit(uint32_t bit) {