Closed alexisgayte closed 3 years ago
https://github.com/makerdao/univ2-lp-oracle/blob/c500d2197f153f70da0e3005e74b87c37ee33a40/src/Univ2LpOracle.sol#L231-232
if (normalizer0 > 1) Is that for gas saving?
if (normalizer0 > 1)
If not and it is to avoid the 0, Don't we want to move it into the constructor? if normalizer0 ==0 ? normalizer0 =1
if normalizer0 ==0 ? normalizer0 =1
normalizer0 is an immutable variable, which is part of the bytecode, so this comparison costs 3 gas.
normalizer0
immutable
https://github.com/makerdao/univ2-lp-oracle/blob/c500d2197f153f70da0e3005e74b87c37ee33a40/src/Univ2LpOracle.sol#L231-232
if (normalizer0 > 1)
Is that for gas saving?If not and it is to avoid the 0, Don't we want to move it into the constructor?
if normalizer0 ==0 ? normalizer0 =1