v3-core
v3-core copied to clipboard
Eliminate unnecessary variable assignments in Position.update()
Position.Update() causes unnecessary variable assignments for positions with zero liquidity delta.
Even if the liquidtyNext
variable is not used when the liquidityDelta is 0, below code assigns the value to the liquidtyNext
.
https://github.com/Uniswap/v3-core/blob/05c10bf6d547d6121622ac51c457f93775e1df09/contracts/libraries/Position.sol#L53-L56
But the liquidtyNext
is not used in below code.
https://github.com/Uniswap/v3-core/blob/05c10bf6d547d6121622ac51c457f93775e1df09/contracts/libraries/Position.sol#L69
Therefore, there is no need to assign self.liquidty value to liquidityNext in line 55. Unnecessary mstore().