aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-05-09 00:07:56 +0800
committerchriseth <c@ethdev.com>2015-05-09 00:07:56 +0800
commit1dfcb4735011dfaa143d6592713ec6b4bf097934 (patch)
tree342f695b874658f8d114130d5f667a1908e1455b
parentbebe76828a6c8ccfc3e61a066a43530f715aeee9 (diff)
downloaddexon-solidity-1dfcb4735011dfaa143d6592713ec6b4bf097934.tar.gz
dexon-solidity-1dfcb4735011dfaa143d6592713ec6b4bf097934.tar.zst
dexon-solidity-1dfcb4735011dfaa143d6592713ec6b4bf097934.zip
Use range-based erase.
-rw-r--r--KnownState.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/KnownState.cpp b/KnownState.cpp
index 7ff0143e..41ac4802 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;