Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove redundant AND before shift
  • Loading branch information
MihaZupan committed Nov 21, 2022
commit fef55c8bfd7dfc96bcfce69e6dd4cc3ff8d9157d
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void Set(int c)
{
Debug.Assert(c < 256);
uint offset = (uint)(c >> 5);
uint significantBit = 1u << (c & 31);
uint significantBit = 1u << c;
_values[offset] |= significantBit;
}

Expand All @@ -36,7 +36,7 @@ private readonly bool ContainsUnchecked(int b)
{
Debug.Assert(b < 256);
uint offset = (uint)(b >> 5);
uint significantBit = 1u << (b & 31);
uint significantBit = 1u << b;
return (_values[offset] & significantBit) != 0;
}

Expand Down