From 942fd2bcfd384a12c900999fe663202c87319a68 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Apr 2021 20:06:18 +0100 Subject: Switch simple iterator loops to use range-based for loops. --- src/modules/m_auditorium.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/modules/m_auditorium.cpp') diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index e2466439b..cbaf5ddcc 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -138,11 +138,10 @@ class ModuleAuditorium if (IsVisible(memb)) return; - const Channel::MemberMap& users = memb->chan->GetUsers(); - for (Channel::MemberMap::const_iterator i = users.begin(); i != users.end(); ++i) + for (const auto& [user, _] : memb->chan->GetUsers()) { - if (IS_LOCAL(i->first) && !CanSee(i->first, memb)) - excepts.insert(i->first); + if (IS_LOCAL(user) && !CanSee(user, memb)) + excepts.insert(user); } } @@ -170,11 +169,10 @@ class ModuleAuditorium // this channel should not be considered when listing my neighbors i = include.erase(i); // however, that might hide me from ops that can see me... - const Channel::MemberMap& users = memb->chan->GetUsers(); - for(Channel::MemberMap::const_iterator j = users.begin(); j != users.end(); ++j) + for (const auto& [user, _] : memb->chan->GetUsers()) { - if (IS_LOCAL(j->first) && CanSee(j->first, memb)) - exception[j->first] = true; + if (IS_LOCAL(user) && CanSee(user, memb)) + exception[user] = true; } } } -- cgit v1.3.1-10-gc9f91