diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bancache.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bancache.cpp b/src/bancache.cpp index a831b1219..bfa1bde11 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -63,4 +63,26 @@ bool BanCacheManager::RemoveHit(BanCacheHit *b) return true; } +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' */ + + /* Actually inserts a std::pair */ + NewHash->insert(*n); + /* End of safe section */ + + n = safei; + } + + delete BanHash; + BanHash = NewHash; +} |