summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-30 12:42:18 +0100
committerSadie Powell <sadie@witchery.services>2025-03-30 12:42:18 +0100
commita154532e982a1f159a7c94a1525944c7d473a687 (patch)
tree0f999eb8bfacea470ee89c44ec4f6c9d797f5975 /src/regchannel.cpp
parent665b0fdef8dd39ff84a3323be3a325b5b30ed4aa (diff)
Use insert_or_assign when creating ChannelInfo instances.
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp4
1 files changed, 1 insertions, 3 deletions
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));