Open vm06007 opened 1 year ago
Should be addressed as part of: https://github.com/wise-foundation/lending-audit/pull/51
Note: in this case if to follow the suggestion the unchcked
cannot be last statement as this loop contains continue;
statement which might skip ++i
iteration leading to errors.
MHR-04C: Loop Iterator Optimization
Description:
The linked
for
loop increments / decrements the iterator "safely" due to Solidity's built-in safe arithmetics (post-0.8.X
).Example:
Recommendation:
We advise the increment / decrement operation to be performed in an
unchecked
code block as the last statement within thefor
loop to optimize its execution cost.