diff --git a/pool/tick_bitmap.gno b/pool/tick_bitmap.gno index 845e9ed2..4c4e9a75 100644 --- a/pool/tick_bitmap.gno +++ b/pool/tick_bitmap.gno @@ -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())