summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()