diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 229e2b8ea..3502abe12 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -31,12 +31,10 @@ Channel::Channel(const std::string &cname, time_t ts) { - chan_hash::iterator findchan = ServerInstance->chanlist->find(cname); - if (findchan != ServerInstance->chanlist->end()) + if (!ServerInstance->chanlist->insert(std::make_pair(cname, this)).second) throw CoreException("Cannot create duplicate channel " + cname); - (*(ServerInstance->chanlist))[cname.c_str()] = this; - this->name.assign(cname, 0, ServerInstance->Config->Limits.ChanMax); + this->name = cname; this->age = ts ? ts : ServerInstance->Time(); maxbans = topicset = 0; |