From 2d6d47b489d733ca3c29fc2f963d424029fcb929 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 11 Nov 2020 02:25:06 +0000 Subject: Add stdalgo::equal_range and switch more stuff to iterator_range. --- src/modules/m_chanlog.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/modules/m_chanlog.cpp') diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp index 860067e5b..1d6c96282 100644 --- a/src/modules/m_chanlog.cpp +++ b/src/modules/m_chanlog.cpp @@ -64,15 +64,14 @@ class ModuleChanLog : public Module ModResult OnSendSnotice(char &sno, std::string &desc, const std::string &msg) override { - std::pair itpair = logstreams.equal_range(sno); - if (itpair.first == itpair.second) + auto channels = stdalgo::equal_range(logstreams, sno); + if (channels.empty()) return MOD_RES_PASSTHRU; const std::string snotice = "\002" + desc + "\002: " + msg; - - for (ChanLogTargets::const_iterator it = itpair.first; it != itpair.second; ++it) + for (const auto& [_, channel] : channels) { - Channel *c = ServerInstance->FindChan(it->second); + Channel* c = ServerInstance->FindChan(channel); if (c) { ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->Config->ServerName, c, snotice); -- cgit v1.3.1-10-gc9f91