summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-12-13 10:57:03 +0000
committerSadie Powell <sadie@witchery.services>2024-12-13 10:57:03 +0000
commit69b94fe0411e1e1ee81e7a576e716edee9f35c03 (patch)
tree676b7a12867d7e8677549d4f7a266fba441cd57e
parent6ba0224f7bf706993bdd94b72e552b131750eeff (diff)
Switch Service::GetServiceKeys to use a range-for loop.
-rw-r--r--include/service.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/service.h b/include/service.h
index dfbe2207a..745c28cd3 100644
--- a/include/service.h
+++ b/include/service.h
@@ -59,10 +59,12 @@ public:
static std::vector<Anope::string> GetServiceKeys(const Anope::string &t)
{
std::vector<Anope::string> keys;
- std::map<Anope::string, std::map<Anope::string, Service *> >::iterator it = Services.find(t);
+ const auto it = Services.find(t);
if (it != Services.end())
- for (std::map<Anope::string, Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
- keys.push_back(it2->first);
+ {
+ for (const auto &[key, _] : it->second)
+ keys.push_back(key);
+ }
return keys;
}