Commit c0d3523c authored by Alessio Netti's avatar Alessio Netti
Browse files

Analytics: fix to unit cache management

parent 13723cef
...@@ -397,8 +397,9 @@ public: ...@@ -397,8 +397,9 @@ public:
} }
if(_unitCache->size() >= _unitCacheLimit) { if(_unitCache->size() >= _unitCacheLimit) {
U_Ptr oldest = _insertionLUT->begin()->second; auto oldest = _insertionLUT->begin();
_unitCache->erase(oldest->getName()); _unitCache->erase(oldest->second->getName());
_insertionLUT->erase(oldest->first);
} }
_unitCache->insert(make_pair(unit->getName(), unit)); _unitCache->insert(make_pair(unit->getName(), unit));
// The template unit must never be deleted, even if the cache is full; therefore, we omit its entry from // The template unit must never be deleted, even if the cache is full; therefore, we omit its entry from
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment