Make limited map actually respect max size
This commit is contained in:
parent
1e92b27540
commit
fd2d862fbc
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue