diff options
| author | 2020-11-11 02:25:06 +0000 | |
|---|---|---|
| committer | 2020-11-11 02:29:36 +0000 | |
| commit | 2d6d47b489d733ca3c29fc2f963d424029fcb929 (patch) | |
| tree | fa38bdd2dcbebdb126d29482bfb7d5389a10c2d4 /src/modules/m_chanlog.cpp | |
| parent | Convert FOREACH_MOD_CUSTOM to a variadic function. (diff) | |
Add stdalgo::equal_range and switch more stuff to iterator_range.
Diffstat (limited to 'src/modules/m_chanlog.cpp')
| -rw-r--r-- | src/modules/m_chanlog.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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<ChanLogTargets::const_iterator, ChanLogTargets::const_iterator> 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); |
