aboutsummaryrefslogtreecommitdiffstats
path: root/docs/control-structures.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r--docs/control-structures.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 9afc7040..5a22cbe3 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))
+ }
+ }
}
}