mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2615 from NIC619/develop
minor fix on assembly example
This commit is contained in:
commit
05f4cc8e78
@ -92,7 +92,7 @@ you really know what you are doing.
|
|||||||
function sumAsm(uint[] _data) returns (uint o_sum) {
|
function sumAsm(uint[] _data) returns (uint o_sum) {
|
||||||
for (uint i = 0; i < _data.length; ++i) {
|
for (uint i = 0; i < _data.length; ++i) {
|
||||||
assembly {
|
assembly {
|
||||||
o_sum := mload(add(add(_data, 0x20), mul(i, 0x20)))
|
o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user