1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 23:43:14 +02:00

Switch Service::GetServiceKeys to use a range-for loop.

This commit is contained in:
Sadie Powell
2024-12-13 10:57:03 +00:00
parent 6ba0224f7b
commit 69b94fe041
+5 -3
View File
@@ -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;
}