summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-07 10:58:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-07 10:58:56 +0000
commit6fef928da861a1c90aca22737e5bc419932702ff (patch)
tree8b915156d05ef9d81c24d82f7d571a2b932f5139 /src/helperfuncs.cpp
parent148835bea39a0a28625bdab7c7c1a709876b76aa (diff)
*TEST CODE* Faster custom mode set/unset
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3508 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 854675378..8562be443 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -1198,19 +1198,18 @@ char* chanmodes(chanrec *chan, bool showkey)
sprintf(foo," %lu",(unsigned long)chan->limit);
strlcat(sparam,foo,MAXBUF);
}
- if (*chan->custom_modes)
+ for (int n = 0; n < 190; n++)
{
- for (char* t = chan->custom_modes; *t; t++)
- *offset++ = *t;
- for (int z = 0; chan->custom_modes[z]; z++)
- {
- std::string extparam = chan->GetModeParameter(chan->custom_modes[z]);
- if (extparam != "")
- {
- charlcat(sparam,' ',MAXBUF);
- strlcat(sparam,extparam.c_str(),MAXBUF);
- }
- }
+ if (custom_modes[n])
+ {
+ *offset++ = n+65;
+ std::string extparam = chan->GetModeParameter(n+65);
+ if (extparam != "")
+ {
+ charlcat(sparam,' ',MAXBUF);
+ strlcat(sparam,extparam.c_str(),MAXBUF);
+ }
+ }
}
/* Null terminate scratch */
*offset = '\0';