Closed AtomicAzzaz closed 1 year ago
Contract | Method | Avg (+/-) | % |
---|---|---|---|
MathFunctions | zeroFloorSub max min divUp |
-38 โ
-34 โ -23 โ -16 โ |
+0.18% +0.16% +0.11% +0.08% |
The same strat can be applied to zeroFloorSub
:
function zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) {
assembly {
z := mul(gt(x, y), sub(x, y))
}
}
from 399 to 361 gas
The same strat can be applied to
zeroFloorSub
:function zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) { assembly { z := mul(gt(x, y), sub(x, y)) } }
from 399 to 361 gas
Of course!
Of course!
@AtomicAzzaz you want to do it or should I do it ?
Of course!
@AtomicAzzaz you want to do it or should I do it ?
I've already done it!
Before:
After:
Same savings for zerFloorSub