summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 00:43:00 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 00:43:00 +0000
commit407c9ca397d2de5753a2bb9ebf1800393b63ef50 (patch)
tree8a1e3f424eb2e23ed44bf5d120e1cebc60fce8f0 /src
parent0708a03ec5f2ef58e0dabd4f039d48083badc969 (diff)
Optimized away a memset made it potentially 10x faster
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2497 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index d9b4c7fa8..385ecedbe 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -389,7 +389,7 @@ void WriteCommon(userrec *u, char* text, ...)
va_end(argsPtr);
// FIX: Stops a message going to the same person more than once
- memset(&already_sent,0,65536);
+ memset(&already_sent,0,MAXCLIENTS);
bool sent_to_at_least_one = false;
@@ -398,7 +398,8 @@ void WriteCommon(userrec *u, char* text, ...)
if (u->chans[i].channel)
{
std::vector<char*> *ulist = u->chans[i].channel->GetUsers();
- for (unsigned int j = 0; j < ulist->size(); j++)
+ unsigned int x = ulist->size();
+ for (unsigned int j = 0; j < x; j++)
{
char* o = (*ulist)[j];
userrec* otheruser = (userrec*)o;