summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-10 17:50:49 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-10 19:27:24 +0200
commit2b1328c3f4b25a9f72cf2c458042ffafc2d5ad6b (patch)
tree8074355141bfb89bf37145482b42dd593dc17b48 /src
parent05ea9815235187a4821d0154ac8d7e1d982e3617 (diff)
BanCache: Remove BanCacheManager::RehashCache()
The function was never called
Diffstat (limited to 'src')
-rw-r--r--src/bancache.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/bancache.cpp b/src/bancache.cpp
index 244ffd758..784f5ded6 100644
--- a/src/bancache.cpp
+++ b/src/bancache.cpp
@@ -88,40 +88,6 @@ void BanCacheManager::RemoveEntries(const std::string& type, bool positive)
}
}
-void BanCacheManager::RehashCache()
-{
- BanCacheHash* NewHash = new BanCacheHash();
-
- BanCacheHash::iterator safei;
- for (BanCacheHash::iterator n = BanHash->begin(); n != BanHash->end(); )
- {
- safei = n;
- safei++;
-
- /* Safe to delete items here through iterator 'n' */
- BanCacheHit *b = n->second;
-
- if (ServerInstance->Time() > b->Expiry)
- {
- /* we need to remove this one. */
- delete b;
- BanHash->erase(n); // WORD TO THE WISE: don't use RemoveHit here, because we MUST remove the iterator in a safe way.
- }
- else
- {
- /* Actually inserts a std::pair */
- NewHash->insert(*n);
- }
-
- /* End of safe section */
-
- n = safei;
- }
-
- delete BanHash;
- BanHash = NewHash;
-}
-
BanCacheManager::~BanCacheManager()
{
for (BanCacheHash::iterator n = BanHash->begin(); n != BanHash->end(); ++n)