diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-10 17:50:49 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-04-10 19:27:24 +0200 |
commit | 2b1328c3f4b25a9f72cf2c458042ffafc2d5ad6b (patch) | |
tree | 8074355141bfb89bf37145482b42dd593dc17b48 /src/bancache.cpp | |
parent | 05ea9815235187a4821d0154ac8d7e1d982e3617 (diff) |
BanCache: Remove BanCacheManager::RehashCache()
The function was never called
Diffstat (limited to 'src/bancache.cpp')
-rw-r--r-- | src/bancache.cpp | 34 |
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) |