Make limited map actually respect max size

This commit is contained in:
Casey Rodarmor 2015-08-17 12:05:47 -04:00 committed by Jack Grigg
parent d3a2f120f5
commit 4a51753b00
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ public:
{
std::pair<iterator, bool> ret = map.insert(x);
if (ret.second) {
if (nMaxSize && map.size() == nMaxSize) {
if (nMaxSize && map.size() > nMaxSize) {
map.erase(rmap.begin()->second);
rmap.erase(rmap.begin());
}