diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-09 00:25:18 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-09 00:25:18 +0000 |
commit | be70931a50f23c68e055602facce5736775f3fab (patch) | |
tree | 5ab53e604456abb30bcb06185bd09414117d4943 /src/inspircd.cpp | |
parent | 7a9d31a46328de9c12e09c6f5620d39251efdf34 (diff) |
Cache channel max bans value to save an O(n) loop of match() on every ban (etc) add
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6267 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index efb842f60..b75a91715 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -148,10 +148,18 @@ void InspIRCd::Rehash(int status) SI->RehashUsersAndChans(); FOREACH_MOD_I(SI, I_OnGarbageCollect, OnGarbageCollect()); SI->Config->Read(false,NULL); + SI->ResetMaxBans(); SI->Res->Rehash(); FOREACH_MOD_I(SI,I_OnRehash,OnRehash(NULL,"")); } +void InspIRCd::ResetMaxBans() +{ + for (chan_hash::const_iterator i = chanlist->begin(); i != chanlist->end(); i++) + i->second->ResetMaxBans(); +} + + /** Because hash_map doesnt free its buckets when we delete items (this is a 'feature') * we must occasionally rehash the hash (yes really). * We do this by copying the entries from the old hash to a new hash, causing all |