diff options
| author | 2015-07-10 18:02:56 -0300 | |
|---|---|---|
| committer | 2015-07-10 18:43:41 -0300 | |
| commit | d5b52805014f537082afae79dc212958295ca9dc (patch) | |
| tree | bd28ec1751301349da62228f4e7c0439d4cc3d28 /src/common/bit_field.h | |
| parent | Common: Fix mask generation in BitField (diff) | |
| download | yuzu-d5b52805014f537082afae79dc212958295ca9dc.tar.gz yuzu-d5b52805014f537082afae79dc212958295ca9dc.tar.xz yuzu-d5b52805014f537082afae79dc212958295ca9dc.zip | |
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 '')
| -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 257d5577d..3bc53500d 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -160,7 +160,7 @@ public: | |||
| 160 | if (std::numeric_limits<T>::is_signed) | 160 | if (std::numeric_limits<T>::is_signed) |
| 161 | { | 161 | { |
| 162 | std::size_t shift = 8 * sizeof(T)-bits; | 162 | std::size_t shift = 8 * sizeof(T)-bits; |
| 163 | return (T)(((storage & GetMask()) << (shift - position)) >> shift); | 163 | return (T)((storage << (shift - position)) >> shift); |
| 164 | } | 164 | } |
| 165 | else | 165 | else |
| 166 | { | 166 | { |