Closed elshan-eth closed 1 month ago
The alternative I had in mind was to ditch tIncrement and tDecrement and just inline the calls to tstore / tload. We only use this in vaultCommon so perhaps it's not that bad. Do you think that'd impact readability?
I tried this but it had the same gas saving but I will compare bytecode, maybe with inline is a little bit better
built-in method with the same value in terms of gas savings and bytecode
built-in method with the same value in terms of gas savings and bytecode
Then I was misguided by forge snaps when I wrote #461 :(
I'd leave it with checked math. It should be OK, but it takes a few minutes to reason about it; it's not immediately obvious when you look at the code. And given that the gas savings are not huge, I'd rather preserve readability here.
Thanks anyway for investigating!
Description
I tried different ways and there we can save only 100 gas.
Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution
Closes #461