Move init/cond into the for loop

This commit is contained in:
Alex Beregszaszi
2017-08-10 17:30:57 +01:00
parent a323486a9b
commit 34503d98d7
+5 -5
View File
@@ -106,13 +106,13 @@ you really know what you are doing.
// Skip over the length field.
_data := add(_data, 0x20)
// Set up a bound.
let end := add(_data, len)
// Iterate until the bound is not met.
for {} lt(_data, end) {} {
for
{ let end := add(_data, len) }
lt(_data, end)
{ _data := add(_data, 0x20) }
{
o_sum := add(o_sum, mload(_data))
_data := add(_data, 0x20)
}
// NOTE: after this point it is not safe to use _data in Solidity code