From d6f05a6d366632a2816dc8c221c5418284997524 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 11 May 2016 15:54:45 -0400 Subject: [PATCH] Increased clarity of assembly statement --- docs/control-structures.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/control-structures.rst b/docs/control-structures.rst index 9afc7040e..5a22cbe38 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -294,8 +294,11 @@ you really know what you are doing. // 0x20 needs to be added to an array because the first slot contains the // array length. function sumAsm(uint[] _data) returns (uint o_sum) { - for (uint i = 0; i < _data.length; ++i) - assembly { o_sum := mload(add(add(_data, 0x20), i)) } + for (uint i = 0; i < _data.length; ++i) { + assembly { + o_sum := mload(add(add(_data, 0x20), i)) + } + } } }