We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2262079 commit f304468Copy full SHA for f304468
src/libraries/BitmapUtils.sol
@@ -62,12 +62,9 @@ library BitmapUtils {
62
function orderedBytesArrayToBitmap(bytes memory orderedBytesArray, uint8 bitUpperBound) internal pure returns (uint256) {
63
uint256 bitmap = orderedBytesArrayToBitmap(orderedBytesArray);
64
65
- if (bitmap != 0) {
66
- require(
67
- uint8(orderedBytesArray[orderedBytesArray.length - 1]) < bitUpperBound,
68
- "BitmapUtils.orderedBytesArrayToBitmap: bitmap exceeds max value"
69
- );
70
- }
+ require((1 << bitUpperBound) > bitmap,
+ "BitmapUtils.orderedBytesArrayToBitmap: bitmap exceeds max value"
+ );
71
72
return bitmap;
73
}
0 commit comments