Unnecessary array boundaries check when loading an array element twice #21
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
Handle
robee
Vulnerability details
There are places in the code (especially in for-each loops) that loads the same array element more
than once. In such cases, only one array boundaries check should take place, and the rest are unnecessary.
Therefore, this array element should be cached in a local variable and then be loaded
again using this local variable, skipping the redundent second array boundaries check:
The text was updated successfully, but these errors were encountered: