The linked for loops increment / decrement their iterator "safely" due to Solidity's built - in safe arithmetics (post-0.8.X).
Example:
for (uint256 i = 0; i < WISE_LENDING.getPositionLendingTokenLength(_nftId); ++i) {
Recommendation:
We advise the increment / decrement operations to be performed in an unchecked code block as the last statement within each for loop to optimize their execution cost.
WSH-04C: Loop Iterator Optimizations
Description:
The linked
for
loops increment / decrement their iterator "safely" due to Solidity's built - in safe arithmetics (post-0.8.X
).Example:
Recommendation:
We advise the increment / decrement operations to be performed in an
unchecked
code block as the last statement within eachfor
loop to optimize their execution cost.