From 441bd151da733d32e194de6e4a1744ae273b83ee Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 31 Oct 2020 20:03:19 +0000 Subject: Add stdalgo::iterator_range and switch config tag reading to use it. This allows us to use range-based for loops which were not possible with the previous config tag system. --- src/modules/m_helpop.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/modules/m_helpop.cpp') diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index a9b732145..37901c612 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -116,13 +116,11 @@ class ModuleHelpop HelpMap newhelp; ConfigTagList tags = ServerInstance->Config->ConfTags("helpop"); - if (tags.first == tags.second) + if (tags.empty()) throw ModuleException("You have loaded the helpop module but not configured any help topics!"); - for (ConfigIter i = tags.first; i != tags.second; ++i) + for (auto& [_, tag] : tags) { - ConfigTag* tag = i->second; - // Attempt to read the help key. const std::string key = tag->getString("key"); if (key.empty()) -- cgit v1.3.1-10-gc9f91