Skip to content

Commit

Permalink
fix warning (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyek committed Jun 4, 2024
1 parent 59915ac commit ae86975
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/libraries/TickBitmap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ library TickBitmap {
/// @param tick The tick to flip
/// @param tickSpacing The spacing between usable ticks
function flipTick(mapping(int16 => uint256) storage self, int24 tick, int24 tickSpacing) internal {
/**
* Equivalent to the following Solidity:
* if (tick % tickSpacing != 0) revert TickMisaligned(tick, tickSpacing);
* (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing);
* uint256 mask = 1 << bitPos;
* self[wordPos] ^= mask;
*/
// Equivalent to the following Solidity:
// if (tick % tickSpacing != 0) revert TickMisaligned(tick, tickSpacing);
// (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing);
// uint256 mask = 1 << bitPos;
// self[wordPos] ^= mask;
assembly ("memory-safe") {
// ensure that the tick is spaced
if smod(tick, tickSpacing) {
Expand Down

0 comments on commit ae86975

Please sign in to comment.