aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-07-10 18:02:56 -0300
committerGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-07-10 18:43:41 -0300
commitd5b52805014f537082afae79dc212958295ca9dc (patch)
treebd28ec1751301349da62228f4e7c0439d4cc3d28 /src/common
parentd7f9529bdd8b24701f8c1c2e62a52c8a7e908137 (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')
-rw-r--r--src/common/bit_field.h2
1 files changed, 1 insertions, 1 deletions
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<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
{