.length in a loop
Closed this issue · 1 comments
code423n4 commented
Handle
pauliax
Vulnerability details
Impact
.length in a loop can be extracted into a variable and used where necessary to reduce the number of storage reads. Cache the length of the array and use this local variable when iterating over the storage array. This can be applied in functions findShareholder and _sendFees:
for (uint256 i = 0; i < shareholders.length; i++) unit shareholdersLength = shareholders.length;
for (uint256 i = 0; i < shareholdersLength; i++)adrien-supizet commented
duplicated #7