diff options
author | Adam <Adam@anope.org> | 2010-11-13 15:20:56 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:33:58 -0500 |
commit | c792c7f62df41c48d0d813a809e5415cbefa38b2 (patch) | |
tree | f7778d83dba9092bdd04ec6cf568c427e34e3218 /src/botserv.cpp | |
parent | e5127603642d3f04a21480697bdf59517775fd8b (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/botserv.cpp')
-rw-r--r-- | src/botserv.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/botserv.cpp b/src/botserv.cpp index 9149a0027..3d25136da 100644 --- a/src/botserv.cpp +++ b/src/botserv.cpp @@ -37,9 +37,9 @@ void get_botserv_stats(long *nrec, long *memuse) { long count = 0, mem = 0; - for (botinfo_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) + for (patricia_tree<BotInfo>::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) { - BotInfo *bi = it->second; + BotInfo *bi = *it; ++count; mem += sizeof(*bi); @@ -361,19 +361,9 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf) BotInfo *findbot(const Anope::string &nick) { if (isdigit(nick[0]) && ircd->ts6) - { - botinfo_uid_map::const_iterator it = BotListByUID.find(nick); - - if (it != BotListByUID.end()) - return it->second; - return NULL; - } - - botinfo_map::const_iterator it = BotListByNick.find(nick); + return BotListByUID.find(nick); - if (it != BotListByNick.end()) - return it->second; - return NULL; + return BotListByNick.find(nick); } /*************************************************************************/ |