From 5c264281ebe261f32fda1e1bc08a7fc46d768ed3 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 11 Jul 2015 22:29:16 -0400 Subject: [PATCH] Common: Remove redundant masking in BitField For the signed case, the shifts already remove the rest of the value, so ANDing by the mask is redundant. --- Source/Core/Common/BitField.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/BitField.h b/Source/Core/Common/BitField.h index 14c03973ad..75a5b104fd 100644 --- a/Source/Core/Common/BitField.h +++ b/Source/Core/Common/BitField.h @@ -156,7 +156,7 @@ public: if (std::numeric_limits::is_signed) { std::size_t shift = 8 * sizeof(T) - bits; - return (T)(((storage & GetMask()) << (shift - position)) >> shift); + return (T)((storage << (shift - position)) >> shift); } else {