From 964201f2d3f67d389faa06556322bc04a554be3e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 25 Mar 2018 16:01:48 -0400 Subject: [PATCH] x64Emitter: Use std::tie in OpArg's operator==. Provide operator!= for symmetry --- Source/Core/Common/x64Emitter.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/x64Emitter.h b/Source/Core/Common/x64Emitter.h index 648fafe08e..d7ebc058e6 100644 --- a/Source/Core/Common/x64Emitter.h +++ b/Source/Core/Common/x64Emitter.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "Common/Assert.h" @@ -117,11 +118,12 @@ struct OpArg indexReg{static_cast(scaled_reg)}, offset{offset_} { } - bool operator==(const OpArg& b) const + constexpr bool operator==(const OpArg& b) const { - return operandReg == b.operandReg && scale == b.scale && offsetOrBaseReg == b.offsetOrBaseReg && - indexReg == b.indexReg && offset == b.offset; + return std::tie(scale, offsetOrBaseReg, indexReg, offset, operandReg) == + std::tie(b.scale, b.offsetOrBaseReg, b.indexReg, b.offset, b.operandReg); } + constexpr bool operator!=(const OpArg& b) const { return !operator==(b); } u64 Imm64() const { DEBUG_ASSERT(scale == SCALE_IMM64);