diff options
| author | 2005-04-26 17:01:59 +0000 | |
|---|---|---|
| committer | 2005-04-26 17:01:59 +0000 | |
| commit | 6d56b904fc9bf79dc954d2bd02ce7cc99f99b479 (patch) | |
| tree | 25308fc368e2a6a5e602e71c674362903e0c3cfa /src/channels.cpp | |
| parent | New Perl ./configure (diff) | |
| download | inspircd++-6d56b904fc9bf79dc954d2bd02ce7cc99f99b479.tar.gz inspircd++-6d56b904fc9bf79dc954d2bd02ce7cc99f99b479.tar.bz2 inspircd++-6d56b904fc9bf79dc954d2bd02ce7cc99f99b479.zip | |
Major *MAJOR* optimizations by double-referencing channels to users
(never need to scan the entire user hash again except in very rare circumstances)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1197 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
| -rw-r--r-- | src/channels.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 41ca0468f..b586871ea 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -119,6 +119,7 @@ chanrec::chanrec() strcpy(key,""); created = topicset = limit = users = 0; topiclock = noexternal = inviteonly = moderated = secret = c_private = false; + internal_userlist.clear(); } void chanrec::SetCustomMode(char mode,bool mode_on) @@ -215,3 +216,28 @@ long chanrec::GetUserCounter() { return (this->users); } + +void chanrec::AddUser(char* castuser) +{ + internal_userlist.push_back(castuser); + log(DEBUG,"Added casted user to channel's internal list"); +} + +void chanrec::DelUser(char* castuser) +{ + for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++) + { + if (*a == castuser) + { + log(DEBUG,"Removed casted user from channel's internal list"); + internal_userlist.erase(a); + return; + } + } + log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name); +} + +std::vector<char*> *chanrec::GetUsers() +{ + return &internal_userlist; +} |
