From 34503d98d7d95fc3a55a60be854809524c1f204e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 27 Jul 2017 15:08:32 +0100 Subject: Move init/cond into the for loop --- docs/assembly.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/assembly.rst b/docs/assembly.rst index 5288089f..377a6530 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -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 -- cgit v1.2.3