]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
There are two forms of map::erase(), one erases by key the other by iterator.
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 4 Nov 2007 00:54:07 +0000 (00:54 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 4 Nov 2007 00:54:07 +0000 (00:54 +0000)
if we erase by key, this involves a second search to find that key.
Fix to pass the iterator instead and avoid the second map search :)

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8488 e03df62e-2008-0410-955e-edbf42e46eb7

src/bancache.cpp

index fe23fd0b7e1dc92091ab50f10f6715db387ff3b1..a831b1219d822562bdad3e0f8bebafa7dcc9329b 100644 (file)
@@ -56,7 +56,7 @@ bool BanCacheManager::RemoveHit(BanCacheHit *b)
        }
        else
        {
-               this->BanHash->erase(b->IP);
+               this->BanHash->erase(i);
        }
 
        delete b;