Merge pull request #5110 from codemascot/libevmasm/Assembly.cpp

Use 'switch' instead of 'else if'
This commit is contained in:
chriseth 2018-10-02 13:18:22 +02:00 committed by GitHub
commit 7609710d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,10 +41,19 @@ void Assembly::append(Assembly const& _a)
auto newDeposit = m_deposit + _a.deposit(); auto newDeposit = m_deposit + _a.deposit();
for (AssemblyItem i: _a.m_items) 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); 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()); i.setData(i.data() + m_subs.size());
break;
default:
break;
}
append(i); append(i);
} }
m_deposit = newDeposit; m_deposit = newDeposit;