From f7981b2f593065246abc5f67a45ad950df845ae2 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Wed, 28 Sep 2016 15:21:45 +0200 Subject: [PATCH] remove debug output and correct iterator increase --- pdns/packetcache.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/packetcache.cc b/pdns/packetcache.cc index e523014f7..02f812a61 100644 --- a/pdns/packetcache.cc +++ b/pdns/packetcache.cc @@ -420,8 +420,10 @@ void PacketCache::cleanup() unsigned int erased = 0, lookedAt = 0; for(auto i = sidx.begin(); i != sidx.end(); lookedAt++) { if(i->ttd < now) { - sidx.erase(i); + i = sidx.erase(i); erased++; + } else { + ++i; } if(toTrim && erased > toTrim / d_maps.size()) @@ -429,8 +431,6 @@ void PacketCache::cleanup() if(lookedAt > lookAt / d_maps.size()) break; - - i++; } totErased += erased; } -- 2.40.0