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_auditorium.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/modules/m_auditorium.cpp') diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 6e1f40506..f7964f253 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -146,17 +146,20 @@ class ModuleAuditorium : public Module BuildExcept(memb, excepts); } - void OnBuildNeighborList(User* source, UserChanList &include, std::map &exception) + void 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 || IsVisible(memb)) + { + i++; continue; + } // this channel should not be considered when listing my neighbors - include.erase(c); + include.erase(i); // however, that might hide me from ops that can see me... const UserMembList* users = c->GetUsers(); for(UserMembCIter j = users->begin(); j != users->end(); j++) -- cgit v1.3.1-10-gc9f91