mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Do this the canonical way.
This commit is contained in:
@@ -89,11 +89,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::sweep
|
|||||||
while(cit!=mCache.end())
|
while(cit!=mCache.end())
|
||||||
{
|
{
|
||||||
if(cit->second->second.first<target)
|
if(cit->second->second.first<target)
|
||||||
{
|
mCache.erase(cit++);
|
||||||
typename std::map<key_type, cache_entry>::iterator cit2=cit;
|
|
||||||
++cit;
|
|
||||||
mCache.erase(cit2);
|
|
||||||
}
|
|
||||||
else ++cit;
|
else ++cit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,11 +98,7 @@ template<typename c_Key, typename c_Data> void TaggedCache<c_Key, c_Data>::sweep
|
|||||||
while(mit!=mMap.end())
|
while(mit!=mMap.end())
|
||||||
{
|
{
|
||||||
if(mit->second->expired())
|
if(mit->second->expired())
|
||||||
{
|
mMap.erase(mit++);
|
||||||
typename std::map<key_type, weak_data_ptr>::iterator mit2=mit;
|
|
||||||
++mit;
|
|
||||||
mMap.erase(mit2);
|
|
||||||
}
|
|
||||||
else ++mit;
|
else ++mit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user