summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-13 15:20:56 -0500
committerAdam <Adam@anope.org>2010-12-12 19:33:58 -0500
commitc792c7f62df41c48d0d813a809e5415cbefa38b2 (patch)
treef7778d83dba9092bdd04ec6cf568c427e34e3218 /src/bots.cpp
parente5127603642d3f04a21480697bdf59517775fd8b (diff)
Switched the system for storing users, channels, and sesions to a patricia
tree from STL's unordered_map, which was giving horrible performance.
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index e1d70d05a..9b2cfddb6 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -9,8 +9,8 @@
#include "modules.h"
#include "commands.h"
-botinfo_map BotListByNick;
-botinfo_uid_map BotListByUID;
+patricia_tree<BotInfo, std::equal_to<ci::string> > BotListByNick;
+patricia_tree<BotInfo> BotListByUID;
BotInfo *BotServ = NULL;
BotInfo *ChanServ = NULL;
@@ -46,9 +46,9 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
else
this->UnsetFlag(BI_CORE);
- BotListByNick[this->nick] = this;
+ BotListByNick.insert(this->nick, this);
if (!this->uid.empty())
- BotListByUID[this->uid] = this;
+ BotListByUID.insert(this->uid, this);
// If we're synchronised with the uplink already, send the bot.
if (Me && Me->IsSynced())
@@ -85,8 +85,8 @@ void BotInfo::SetNewNick(const Anope::string &newnick)
this->nick = newnick;
- UserListByNick[this->nick] = this;
- BotListByNick[this->nick] = this;
+ UserListByNick.insert(this->nick, this);
+ BotListByNick.insert(this->nick, this);
}
void BotInfo::RejoinAll()