Skip to content

Commit

Permalink
merkledb -- shift nit (#2218)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Laine <[email protected]>
  • Loading branch information
Dan Laine authored Oct 26, 2023
1 parent e933587 commit fe74ed1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/merkledb/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func (k Key) HasPrefix(prefix Key) bool {

// check that the tokens in the partially filled final byte of [prefix] are
// equal to the tokens in the final byte of [k].
remainderBitsMask := byte(0xFF << (8 - remainderTokensCount*int(k.tokenBitSize)))
prefixRemainderTokens := prefix.value[len(prefix.value)-1] & remainderBitsMask
remainderTokens := k.value[len(prefix.value)-1] & remainderBitsMask
remainderBitsMask := byte(0xFF >> (remainderTokensCount * int(k.tokenBitSize)))
prefixRemainderTokens := prefix.value[len(prefix.value)-1] | remainderBitsMask
remainderTokens := k.value[len(prefix.value)-1] | remainderBitsMask

if prefixRemainderTokens != remainderTokens {
return false
Expand Down

0 comments on commit fe74ed1

Please sign in to comment.