summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-11-19 19:50:57 +0000
committerSadie Powell <sadie@witchery.services>2024-11-19 19:55:34 +0000
commite9202916b21932d3b06b1aa38c8d8ed4ea1cfb7e (patch)
treee0590b8d8a365e59f1fe1425403ff8c7b74ef774
parent2cb20ded789b50f7e354ed88baf40b60fdc14d96 (diff)
Emplace services when registering them with the core.
-rw-r--r--include/service.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/service.h b/include/service.h
index 87a04ece1..dfbe2207a 100644
--- a/include/service.h
+++ b/include/service.h
@@ -98,10 +98,8 @@ public:
void Register()
{
- std::map<Anope::string, Service *> &smap = Services[this->type];
- if (smap.find(this->name) != smap.end())
+ if (!Services[this->type].emplace(this->name, this).second)
throw ModuleException("Service " + this->type + " with name " + this->name + " already exists");
- smap[this->name] = this;
}
void Unregister()