aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDenton Liu <liu.denton+github@gmail.com>2016-05-12 03:54:45 +0800
committerDenton Liu <liu.denton+github@gmail.com>2016-05-18 23:23:48 +0800
commitd6f05a6d366632a2816dc8c221c5418284997524 (patch)
tree6cd0f84817daea53637fb9c6bb550586ac3df8bc /docs
parent14bd009eb61376698e866b7f2a7da8e4282930dd (diff)
downloaddexon-solidity-d6f05a6d366632a2816dc8c221c5418284997524.tar.gz
dexon-solidity-d6f05a6d366632a2816dc8c221c5418284997524.tar.zst
dexon-solidity-d6f05a6d366632a2816dc8c221c5418284997524.zip
Increased clarity of assembly statement
Diffstat (limited to 'docs')
-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))
+ }
+ }
}
}