summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-09 00:25:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-09 00:25:18 +0000
commitbe70931a50f23c68e055602facce5736775f3fab (patch)
tree5ab53e604456abb30bcb06185bd09414117d4943 /include
parent7a9d31a46328de9c12e09c6f5620d39251efdf34 (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 'include')
-rw-r--r--include/channels.h8
-rw-r--r--include/inspircd.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/include/channels.h b/include/channels.h
index a85e69dd1..17e7364a4 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -124,6 +124,10 @@ class chanrec : public Extensible
prefixlist prefixes;
+ /** Maximum number of bans (cached)
+ */
+ int maxbans;
+
public:
/** The channels name.
*/
@@ -510,6 +514,10 @@ class chanrec : public Extensible
*/
bool IsBanned(userrec* user);
+ /** Clears the cached max bans value
+ */
+ void ResetMaxBans();
+
/** Destructor for chanrec
*/
virtual ~chanrec() { /* stub */ }
diff --git a/include/inspircd.h b/include/inspircd.h
index 0e53ce1c4..1931c3987 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -1169,6 +1169,11 @@ class InspIRCd : public classbase
*/
void RehashUsersAndChans();
+ /** Resets the cached max bans value on all channels.
+ * Called by rehash.
+ */
+ void ResetMaxBans();
+
/** Begin execution of the server.
* NOTE: this function NEVER returns. Internally,
* after performing some initialisation routines,