Skip to content

Commit

Permalink
chore: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Dec 16, 2024
1 parent 21df7a0 commit a926b6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pool/tick_bitmap.gno
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ func getWordAndBitPos(tick int32, lte bool) (int16, uint8) {
// The function constructs a bitmask with a shift depending on the bit position and the boolean value.
// It either returns the mask or its negation, based on the value of 'lte' (swap direction).
func getMaskBit(bitPos uint, lte bool) *u256.Uint {
// Shift the number 1 to the left by (bitPos + bitPosAdjust) positions.
// Shift the number 1 to the left by (bitPos + bitOffset) positions.
// If lte is true, the shift will be bitPos + 1; if false, it will be just bitPos.
var bitPosAdjust uint
var bitOffset uint
if lte {
bitPosAdjust = 1
bitOffset = 1
}

shifted := new(u256.Uint).Lsh(u256.One(), bitPos+bitPosAdjust)
shifted := new(u256.Uint).Lsh(u256.One(), bitPos+bitOffset)

// Subtract 1 from the shifted value to create a mask.
mask := new(u256.Uint).Sub(shifted, u256.One())
Expand Down

0 comments on commit a926b6c

Please sign in to comment.