From d5b52805014f537082afae79dc212958295ca9dc Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 10 Jul 2015 18:02:56 -0300 Subject: 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. --- src/common/bit_field.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 257d5577..3bc53500 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -160,7 +160,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 { -- cgit v1.2.3