From 6fef928da861a1c90aca22737e5bc419932702ff Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 7 Mar 2006 10:58:56 +0000 Subject: *TEST CODE* Faster custom mode set/unset git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3508 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/helperfuncs.cpp') 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'; -- cgit v1.2.3