summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-12 20:14:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-12 20:14:43 +0000
commit8aa7f73bd76d5faacbfef59b308de7314d926fbf (patch)
tree26e61b6aa53ff4cea5367feb962951c4de330d1d /src/channels.cpp
parentc4dffdedf72f6a2061e19725e4b50b2d28397085 (diff)
Changed channel user lists from vector to map
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2780 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index c51321a64..a1a7d60fa 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -160,25 +160,23 @@ long chanrec::GetUserCounter()
void chanrec::AddUser(char* castuser)
{
- internal_userlist.push_back(castuser);
+ internal_userlist[castuser] = 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++)
+ std::map<char*,char*>::iterator a = internal_userlist.find(castuser);
+ if (a != internal_userlist.end())
{
- if (*a == castuser)
- {
- log(DEBUG,"Removed casted user from channel's internal list");
- internal_userlist.erase(a);
- return;
- }
+ 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()
+std::map<char*,char*> *chanrec::GetUsers()
{
return &internal_userlist;
}