angle-core
angle-core copied to clipboard
Update Core.sol: Gas Optimizations
The PR is mainly based on two types of optimizations besides some typos fixes:
- Improved For loops: These loops have been enhanced using
uncheckedblock and changingi++to++iwhich is kind of gas efficient and probably doesn't create any logic change in the code as far as I am concerned. But still do take a look. for more reference - https://gist.github.com/grGred/9bab8b9bad0cd42fc23d4e31e7347144#for-loops-improvement - Using internal functions for Modifiers: Whenever any particular modifier is kind of used several times in a code, it's better to use an internal function for it. This seems a worthy one for the current change. Also, we do need to take care of the tradeoffs that do occur with this kind of change.
Thanks @sogipec @GuillaumeNervoXS