Reduce gas in log256#3745
Conversation
|
Do you know how much gas this saves? Waiting to see what our gas reports say. Regardless, it looks good to me. I would put this on 4.8 (currently in release candidate, feature frozen). @Amxx would you agree? |
|
A |
|
I'm usually against adding non essential thing in the middle of a rc ... and saving 2 gas really doesn't feel essential. However, we already have a rc update planned, so if you feel like taking this opportunity and adding it, I wouldn't oppose it. |
|
Congrats, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2022 OpenZeppelin Contracts Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |

This PR replaces a multiplication by 8 inside
log256(uint256, Rounding)with shifting the bits by 3. There's other usages of multiplication/division through bitshifts in the same file so I don't think this is an example of being overly "optimizooor".PR Checklist
The change is covered by the existing tests and this changes doesn't warrant docs.