Skip to content

Commit

Permalink
fix: _split has to return uint8
Browse files Browse the repository at this point in the history
  • Loading branch information
detectivekim committed Nov 2, 2023
1 parent 7e065cd commit 9f31747
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/MinBitMap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ library MinBitMap {
return core.bitmap == 0;
}

function _split(uint24 value) private pure returns (uint256 wordIndex, uint256 bitIndex) {
function _split(uint24 value) private pure returns (uint256 wordIndex, uint8 bitIndex) {
assembly {
bitIndex := value
wordIndex := shr(8, value)
Expand Down Expand Up @@ -56,9 +56,9 @@ library MinBitMap {

core.bitmapMapping[wordIndex] = word | mask;
if (word == 0) {
mask = 1 << (wordIndex & 0xff);
wordIndex = wordIndex >> 8;
core.bitmap = core.bitmap | (1 << wordIndex);
mask = 1 << (wordIndex & 0xff);
wordIndex = ~wordIndex;
core.bitmapMapping[wordIndex] = core.bitmapMapping[wordIndex] | mask;
}
Expand Down

0 comments on commit 9f31747

Please sign in to comment.