summaryrefslogtreecommitdiff
path: root/src/cull_list.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-16 16:19:57 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-16 16:19:57 +0000
commitaf9d3617375b3fb013dc6ac49a1926bde4f775e0 (patch)
treec46b85581642518b7d8a1474014c3cdd37f14f6e /src/cull_list.cpp
parent72fe978b29fa7d9fd7f8e9c2766c06ab1a0a8bc7 (diff)
Remove an O(log n) in favour of an O(1) operation, and tidy up culllist some more
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8717 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cull_list.cpp')
-rw-r--r--src/cull_list.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/cull_list.cpp b/src/cull_list.cpp
index 2b769e893..365cca231 100644
--- a/src/cull_list.cpp
+++ b/src/cull_list.cpp
@@ -19,16 +19,14 @@
CullList::CullList(InspIRCd* Instance) : ServerInstance(Instance)
{
list.clear();
- exempt.clear();
}
void CullList::AddItem(User* user)
{
- if (exempt.find(user) == exempt.end())
- {
- list.push_back(user);
- exempt[user] = user;
- }
+ if (user->quitting)
+ return;
+
+ list.push_back(user);
}
void CullList::MakeSilent(User* user)
@@ -48,7 +46,6 @@ int CullList::Apply()
User *u = (*a);
user_hash::iterator iter = ServerInstance->clientlist->find(u->nick);
- std::map<User*, User*>::iterator exemptiter = exempt.find(u);
const char* preset_reason = u->GetOperQuit();
std::string reason = u->operquitmsg;
std::string oper_reason = *preset_reason ? preset_reason : u->operquitmsg;
@@ -131,7 +128,6 @@ int CullList::Apply()
delete u;
list.erase(list.begin());
- exempt.erase(exemptiter);
}
return n;