Skip to main content
2 of 3
obsolete part
dfhwze
  • 13.9k
  • 3
  • 38
  • 101

Review

  • The postfix AtIndex is too verbose. You don't have any other operations like AtMask or anything and the index is provided as argument. So I would prefer IsBitSet over IsBitSetAtIndex etc.
  • The index is sometimes a byte, sometimes a uint. I would not bother with such level of (over-)engineered type picks. Stick with the common type for an index int. You can always add argument checks for bounds.
  • You can replace 1 << 7 - index with 1 << index in your operations. This is written more compactly and is a well known bit operation technique.
dfhwze
  • 13.9k
  • 3
  • 38
  • 101