diff options
author | Khan M Rashedun-Naby <naby88@gmail.com> | 2018-09-27 16:01:45 +0800 |
---|---|---|
committer | Khan M Rashedun-Naby <naby88@gmail.com> | 2018-09-27 19:46:53 +0800 |
commit | 14738d05e4ae95f5676f4615f0c1862430eb3a5d (patch) | |
tree | 75a608e9f66d6e355fff2bf727424318f284c78f | |
parent | 9508406984c1e83e6ce571af4af593c33aed52e6 (diff) | |
download | dexon-solidity-14738d05e4ae95f5676f4615f0c1862430eb3a5d.tar.gz dexon-solidity-14738d05e4ae95f5676f4615f0c1862430eb3a5d.tar.zst dexon-solidity-14738d05e4ae95f5676f4615f0c1862430eb3a5d.zip |
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; |