From 365372799e5f4d158dfb86cf6d0d2f6d6ecc5708 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 8 May 2015 18:07:56 +0200 Subject: [PATCH] Use range-based erase. --- libevmasm/KnownState.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index 7ff0143e1..41ac4802b 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -151,8 +151,10 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool ); } } - for (int p = m_stackHeight; p > m_stackHeight + _item.deposit(); --p) - m_stackElements.erase(p); + m_stackElements.erase( + m_stackElements.upper_bound(m_stackHeight + _item.deposit()), + m_stackElements.end() + ); m_stackHeight += _item.deposit(); } return op;