Browse Source

Make limited map actually respect max size

0.13
Casey Rodarmor 9 years ago
parent
commit
fd2d862fbc
  1. 2
      src/limitedmap.h

2
src/limitedmap.h

@ -38,7 +38,7 @@ public: @@ -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…
Cancel
Save