From 1dfcb4735011dfaa143d6592713ec6b4bf097934 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 8 May 2015 18:07:56 +0200 Subject: [PATCH] Use range-based erase. --- KnownState.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/KnownState.cpp b/KnownState.cpp index 7ff0143e1..41ac4802b 100644 --- a/KnownState.cpp +++ b/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;