mirror of
https://github.com/anope/anope.git
synced 2026-07-01 12:06:38 +02:00
Emplace services when registering them with the core.
This commit is contained in:
+1
-3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user