]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Optimized away a memset made it potentially 10x faster
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 6b2d9fc494502dce91f97056096ca2a542924293..385ecedbea86a6c9a005b4d03a8204c25b2a75f5 100644 (file)
@@ -19,7 +19,6 @@ using namespace std;
 #include "inspircd_config.h"
 #include "inspircd.h"
 #include "inspircd_io.h"
-#include "inspircd_util.h"
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/errno.h>
@@ -390,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;
 
@@ -399,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;