Use range-based erase.

This commit is contained in:
chriseth 2015-05-08 18:07:56 +02:00
parent bebe76828a
commit 1dfcb47350

View File

@ -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;