mirror of
https://github.com/anope/anope.git
synced 2026-06-27 04:46:37 +02:00
Duplicate check some of these larger hashmaps on insert, just incase
This commit is contained in:
@@ -37,7 +37,10 @@ Channel::Channel(const Anope::string &nname, time_t ts) : Flags<ChannelFlag, 3>(
|
||||
|
||||
this->name = nname;
|
||||
|
||||
size_t old = ChannelList.size();
|
||||
ChannelList[this->name] = this;
|
||||
if (old == ChannelList.size())
|
||||
Log(LOG_DEBUG) << "Duplicate channel " << this->name << " in table?";
|
||||
|
||||
this->creation_time = ts;
|
||||
this->server_modetime = this->chanserv_modetime = 0;
|
||||
|
||||
@@ -41,7 +41,10 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore* nickcore) : Serial
|
||||
this->nc = nickcore;
|
||||
nickcore->aliases.push_back(this);
|
||||
|
||||
size_t old = NickAliasList->size();
|
||||
(*NickAliasList)[this->nick] = this;
|
||||
if (old == NickAliasList->size())
|
||||
Log(LOG_DEBUG) << "Duplicate nick " << nickname << " in nickalias table";
|
||||
|
||||
if (this->nc->o == NULL)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,10 @@ NickCore::NickCore(const Anope::string &coredisplay) : Serializable("NickCore"),
|
||||
if (Config->NSDefFlags.HasFlag(static_cast<NickCoreFlag>(t)))
|
||||
this->SetFlag(static_cast<NickCoreFlag>(t));
|
||||
|
||||
size_t old = NickCoreList->size();
|
||||
(*NickCoreList)[this->display] = this;
|
||||
if (old == NickCoreList->size())
|
||||
Log(LOG_DEBUG) << "Duplicate account " << coredisplay << " in nickcore table?";
|
||||
}
|
||||
|
||||
/** Default destructor
|
||||
|
||||
@@ -266,7 +266,10 @@ ChannelInfo::ChannelInfo(const Anope::string &chname) : Serializable("ChannelInf
|
||||
for (int i = 0; i < TTB_SIZE; ++i)
|
||||
this->ttb[i] = 0;
|
||||
|
||||
size_t old = RegisteredChannelList->size();
|
||||
(*RegisteredChannelList)[this->name] = this;
|
||||
if (old == RegisteredChannelList->size())
|
||||
Log(LOG_DEBUG) << "Duplicate channel " << this->name << " in registered channel table?";
|
||||
|
||||
FOREACH_MOD(I_OnCreateChan, OnCreateChan(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user