aboutsummaryrefslogtreecommitdiffstats
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-08-31 22:50:56 +0000
committerGravatar brain2006-08-31 22:50:56 +0000
commit74b5dabce28ef513118142ae1856fce1f53b5a95 (patch)
tree228f8a7e56c9aa89f9df0cf1d23418cb5d0b6320 /src/channels.cpp
parentPut some client quit stuff in cmd_quit into the Qq snomasks properly (diff)
downloadinspircd++-74b5dabce28ef513118142ae1856fce1f53b5a95.tar.gz
inspircd++-74b5dabce28ef513118142ae1856fce1f53b5a95.tar.bz2
inspircd++-74b5dabce28ef513118142ae1856fce1f53b5a95.zip
Made CountChannels faster. We use it in quite a few places. It's now O(1) rather than O(n)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5094 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index f340e12bf..5c3bb266f 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -425,6 +425,7 @@ chanrec* chanrec::ForceChan(InspIRCd* Instance, chanrec* Ptr,ucrec *a,userrec* u
a->channel = Ptr;
Ptr->AddUser(user);
+ user->ModChannelCount(1);
Ptr->WriteChannel(user,"JOIN :%s",Ptr->name);
/* Major improvement by Brain - we dont need to be calculating all this pointlessly for remote users */
@@ -467,6 +468,7 @@ long chanrec::PartUser(userrec *user, const char* reason)
}
user->chans[i]->uc_modes = 0;
user->chans[i]->channel = NULL;
+ user->ModChannelCount(-1);
this->RemoveAllPrefixes(user);
break;
}