diff options
author | chriseth <chris@ethereum.org> | 2018-10-02 19:18:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 19:18:22 +0800 |
commit | 7609710d4f8e169784c7a8418da702ac236f5e23 (patch) | |
tree | aa65b5f62e8923b0bd57e77de2ae0d8ca22defb6 | |
parent | b77b79c46f197e5019fd128be78f27b95d5b4e25 (diff) | |
parent | 14738d05e4ae95f5676f4615f0c1862430eb3a5d (diff) | |
download | dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.tar dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.tar.gz dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.tar.bz2 dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.tar.lz dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.tar.xz dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.tar.zst dexon-solidity-7609710d4f8e169784c7a8418da702ac236f5e23.zip |
Merge pull request #5110 from codemascot/libevmasm/Assembly.cpp
Use 'switch' instead of 'else if'
-rw-r--r-- | libevmasm/Assembly.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 63452f36..c2eaa1ca 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -41,10 +41,19 @@ void Assembly::append(Assembly const& _a) auto newDeposit = m_deposit + _a.deposit(); for (AssemblyItem i: _a.m_items) { - if (i.type() == Tag || i.type() == PushTag) + switch (i.type()) + { + case Tag: + case PushTag: i.setData(i.data() + m_usedTags); - else if (i.type() == PushSub || i.type() == PushSubSize) + break; + case PushSub: + case PushSubSize: i.setData(i.data() + m_subs.size()); + break; + default: + break; + } append(i); } m_deposit = newDeposit; |