diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-29 23:34:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-29 23:34:47 +0000 |
commit | 5e9a6b9186a8cbaaf65ae7d9cd9c0c033c91b497 (patch) | |
tree | 5e90ee569ad974e0affe96d02b3470345eb74192 /src/modes/umode_i.cpp | |
parent | b848ca14335adcb924acb7977d93e0d76b9437b7 (diff) |
Add counter system for umodes to get rid of some O(n)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6163 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modes/umode_i.cpp')
-rw-r--r-- | src/modes/umode_i.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modes/umode_i.cpp b/src/modes/umode_i.cpp index 73d7293a8..e3f81c529 100644 --- a/src/modes/umode_i.cpp +++ b/src/modes/umode_i.cpp @@ -31,9 +31,15 @@ ModeAction ModeUserInvisible::OnModeChange(userrec* source, userrec* dest, chanr if (dest->modes[UM_INVISIBLE] != adding) { dest->modes[UM_INVISIBLE] = adding; + this->count += (adding ? 1: -1); return MODEACTION_ALLOW; } /* Allow the change */ return MODEACTION_DENY; } + +unsigned int GetCount() +{ + return count; +} |