1
0
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:
Sadie Powell
2024-11-19 19:50:57 +00:00
parent 2cb20ded78
commit e9202916b2
+1 -3
View File
@@ -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()