aave / protocol-v2

Aave Protocol V2
https://aave.com
Other
658 stars 744 forks source link

Update ATokensAndRatesHelper.sol #329

Open 0xScratch opened 12 months ago

0xScratch commented 12 months ago

2 Types of changes made:

1st -> Struct Packing - This makes clear that structs uses as less slots as possible in order to save gas, the combination of address bool bool now uses 1 slot rather than 2 in the earlier implementation Refer this -> https://dev.to/javier123454321/solidity-gas-optimizations-pt-3-packing-structs-23f4

2nd -> For loop improvement - uint256 i = 0 changed to uint256 i, usually all unsigned integers have a default value as 0 And, i++ to ++i, This is really a good gas enhancement unless this change messes up with the code's logic which I feel it don't Refer this -> https://gist.github.com/grGred/9bab8b9bad0cd42fc23d4e31e7347144#for-loops-improvement

height[bot] commented 12 months ago

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.