You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm curious though if that contract makes sense. The other overload of the method(although only used for test purposes), doesn't throw and fails therefore:
[Theory]
[InlineData(0b_11110011, 0)]
[InlineData(0b_11110011, -1)]
public void ThrowsWhenBitIndexOutOfRange_ByteOverload(byte data, int index)
{
Assert.Throws<IndexOutOfRangeException>(() =>
BitUtility.GetBit(data, index));
}
Proposal: either accept my PR or let me create a new one where I include both fixes:
Describe the enhancement requested
The C# implementation of the BitUtility helper class seems to allocate an array every time GetBit is called:
using a static cached BitMask array or creating the bit mask using a shift operator should increase performance.
Component(s)
C#
The text was updated successfully, but these errors were encountered: