From c1a07677db2bb0b023d5eb3565353cb0843eefbf Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Tue, 13 Apr 2010 12:47:42 -0500 Subject: Change UserChanList to an intrusive-style linked list --- src/modules/m_delayjoin.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/m_delayjoin.cpp') diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp index 86a8ee0df..9e7d81e9c 100644 --- a/src/modules/m_delayjoin.cpp +++ b/src/modules/m_delayjoin.cpp @@ -46,7 +46,7 @@ class ModuleDelayJoin : public Module void CleanUser(User* user); void OnUserPart(Membership*, std::string &partmessage, CUList&); void OnUserKick(User* source, Membership*, const std::string &reason, CUList&); - void OnBuildNeighborList(User* source, UserChanList &include, std::map &exception); + void OnBuildNeighborList(User* source, std::vector &include, std::map &exception); void OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list); }; @@ -124,15 +124,17 @@ void ModuleDelayJoin::OnUserKick(User* source, Membership* memb, const std::stri populate(except, memb); } -void ModuleDelayJoin::OnBuildNeighborList(User* source, UserChanList &include, std::map &exception) +void ModuleDelayJoin::OnBuildNeighborList(User* source, std::vector &include, std::map &exception) { - UCListIter i = include.begin(); + std::vector::iterator i = include.begin(); while (i != include.end()) { - Channel* c = *i++; + Channel* c = *i; Membership* memb = c->GetUser(source); if (memb && unjoined.get(memb)) - include.erase(c); + include.erase(i); + else + i++; } } -- cgit v1.3.1-10-gc9f91