kadenzipfel / gas-optimizations

List of smart contract optimizations in solidity
610 stars 61 forks source link

Use do while if loop should run at least once #11

Open kadenzipfel opened 2 years ago

kadenzipfel commented 2 years ago

in general, do while loops are cheaper than for loops. as long as the loop is must run at least once, do while is preferred over for loops