From dc0f0a6576ee066b3d9fa802459d09b69e7631cc Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 16 Feb 2012 14:37:13 -0800 Subject: [PATCH] Do this the canonical way. --- TaggedCache.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/TaggedCache.h b/TaggedCache.h index aff1e0695..51bc3ab96 100644 --- a/TaggedCache.h +++ b/TaggedCache.h @@ -89,11 +89,7 @@ template void TaggedCache::sweep while(cit!=mCache.end()) { if(cit->second->second.first::iterator cit2=cit; - ++cit; - mCache.erase(cit2); - } + mCache.erase(cit++); else ++cit; } @@ -102,11 +98,7 @@ template void TaggedCache::sweep while(mit!=mMap.end()) { if(mit->second->expired()) - { - typename std::map::iterator mit2=mit; - ++mit; - mMap.erase(mit2); - } + mMap.erase(mit++); else ++mit; } }