Преглед на файлове

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.
Yuri Kunde Schlesner преди 11 години
родител
ревизия
d5b5280501
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/common/bit_field.h

+ 1 - 1
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
         {