summaryrefslogtreecommitdiff
path: root/modules/extra/db_mysql.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 /modules/extra/db_mysql.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 'modules/extra/db_mysql.cpp')
-rw-r--r--modules/extra/db_mysql.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp
index fc9f47df9..6f18077f8 100644
--- a/modules/extra/db_mysql.cpp
+++ b/modules/extra/db_mysql.cpp
@@ -951,9 +951,9 @@ class DBMySQL : public Module
FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteChannelMetadata, CurChannel));
}
- 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)
{
- CurBot = it->second;
+ CurBot = *it;
FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteBotMetadata, CurBot));
/* This is for the core bots, bots added by users are already handled by an event */
@@ -1525,8 +1525,8 @@ static void SaveDatabases()
me->RunQuery("TRUNCATE TABLE `anope_bs_core`");
- for (botinfo_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
- me->OnBotCreate(it->second);
+ for (patricia_tree<BotInfo>::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it)
+ me->OnBotCreate(*it);
me->RunQuery("TRUNCATE TABLE `anope_cs_info`");
me->RunQuery("TRUNCATE TABLE `anope_bs_badwords`");