diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-07-10 18:02:56 -0300 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-07-10 18:43:41 -0300 |
commit | d5b52805014f537082afae79dc212958295ca9dc (patch) | |
tree | bd28ec1751301349da62228f4e7c0439d4cc3d28 /src/common/bit_field.h | |
parent | d7f9529bdd8b24701f8c1c2e62a52c8a7e908137 (diff) |
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.
Diffstat (limited to 'src/common/bit_field.h')
-rw-r--r-- | src/common/bit_field.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 257d5577d4..3bc53500d8 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -160,7 +160,7 @@ public: if (std::numeric_limits<T>::is_signed) { std::size_t shift = 8 * sizeof(T)-bits; - return (T)(((storage & GetMask()) << (shift - position)) >> shift); + return (T)((storage << (shift - position)) >> shift); } else { |