From a154532e982a1f159a7c94a1525944c7d473a687 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 30 Mar 2025 12:42:18 +0100 Subject: Use insert_or_assign when creating ChannelInfo instances. --- src/regchannel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/regchannel.cpp b/src/regchannel.cpp index fc8395f75..f45803e06 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -119,9 +119,7 @@ ChannelInfo::ChannelInfo(const Anope::string &chname) if (this->c) this->c->ci = this; - size_t old = RegisteredChannelList->size(); - (*RegisteredChannelList)[this->name] = this; - if (old == RegisteredChannelList->size()) + if (!RegisteredChannelList->insert_or_assign(this->name, this).second) Log(LOG_DEBUG) << "Duplicate channel " << this->name << " in registered channel table?"; FOREACH_MOD(OnCreateChan, (this)); -- cgit