summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-25 11:45:17 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-25 11:45:17 +0000
commitd2e678e8017673f3ef0327f7807bfb1f31c71d33 (patch)
tree62b9a22bfd3e9ef5feeea5f45ef71c57ba63675f
parentc5c256e8a3058e1d87caac28eff8214498fb8d52 (diff)
Speed improvements to userrec::GlobalCloneCount()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5320 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/users.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 46d841de5..c15a3331b 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1000,17 +1000,21 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
long userrec::GlobalCloneCount()
{
- char u1[1024] = {0};
- char u2[1024] = {0};
+ char u1[128] = {0};
+ char u2[128] = {0};
long x = 0;
+
+ this->GetIPString(u2);
+
for (user_hash::const_iterator a = ServerInstance->clientlist.begin(); a != ServerInstance->clientlist.end(); a++)
{
/* We have to match ip's as strings - we don't know what protocol
* a remote user may be using
*/
- if (!strcasecmp(a->second->GetIPString(u1), this->GetIPString(u2)))
- x++;
+ if (strcmp(a->second->GetIPString(u1), u2) == 0)
+ x++;
}
+
return x;
}