diff options
author | Adam <Adam@anope.org> | 2010-11-21 00:20:36 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:35:30 -0500 |
commit | 7790a7f98c56a16e6fed2bf51168881902880c62 (patch) | |
tree | 1c1854ec1ef603385c7c85fb967e0500fbc55315 /src | |
parent | 246f44b9888161aecefc81f0ff17ddd893287e3c (diff) |
Allow the patricia tree to store non-pointers
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 4 | ||||
-rw-r--r-- | src/botserv.cpp | 2 | ||||
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/logger.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 6 | ||||
-rw-r--r-- | src/modes.cpp | 2 | ||||
-rw-r--r-- | src/operserv.cpp | 4 | ||||
-rw-r--r-- | src/servers.cpp | 2 | ||||
-rw-r--r-- | src/sessions.cpp | 9 | ||||
-rw-r--r-- | src/users.cpp | 6 |
10 files changed, 17 insertions, 22 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 3d57afe6e..09742acff 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -9,8 +9,8 @@ #include "modules.h" #include "commands.h" -patricia_tree<BotInfo, std::equal_to<ci::string> > BotListByNick; -patricia_tree<BotInfo> BotListByUID; +patricia_tree<BotInfo *, std::equal_to<ci::string> > BotListByNick; +patricia_tree<BotInfo *> BotListByUID; BotInfo *BotServ = NULL; BotInfo *ChanServ = NULL; diff --git a/src/botserv.cpp b/src/botserv.cpp index af3b0ee4e..82826b489 100644 --- a/src/botserv.cpp +++ b/src/botserv.cpp @@ -37,7 +37,7 @@ void get_botserv_stats(long *nrec, long *memuse) { long count = 0, mem = 0; - for (patricia_tree<BotInfo>::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; diff --git a/src/init.cpp b/src/init.cpp index 26f2144fb..81b9c2c36 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -37,7 +37,7 @@ void introduce_user(const Anope::string &user) } /* We make the bots go online */ - for (patricia_tree<User>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; ++it) + for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; ++it) { User *u = *it; diff --git a/src/logger.cpp b/src/logger.cpp index dbcb9cf60..70ce988f6 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -36,7 +36,7 @@ void InitLogChannels(ServerConfig *config) c->SetFlag(CH_LOGCHAN); c->SetFlag(CH_PERSIST); - for (patricia_tree<BotInfo>::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; diff --git a/src/main.cpp b/src/main.cpp index a18d19a56..180af0729 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -172,7 +172,7 @@ void do_restart_services() if (quitmsg.empty()) quitmsg = "Restarting"; /* Send a quit for all of our bots */ - for (patricia_tree<BotInfo>::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; @@ -214,7 +214,7 @@ static void services_shutdown() if (started && UplinkSock) { /* Send a quit for all of our bots */ - for (patricia_tree<BotInfo>::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; @@ -495,7 +495,7 @@ int main(int ac, char **av, char **envp) FOREACH_MOD(I_OnServerDisconnect, OnServerDisconnect()); /* Clear all of our users, but not our bots */ - for (patricia_tree<User>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) + for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) { User *u = *it; ++it; diff --git a/src/modes.cpp b/src/modes.cpp index 4d31f2232..7439c852c 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -78,7 +78,7 @@ void SetDefaultMLock(ServerConfig *config) } /* Apply the new modes to channels */ - for (patricia_tree<BotInfo>::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; diff --git a/src/operserv.cpp b/src/operserv.cpp index 727432585..e7de407bd 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -582,7 +582,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ { Anope::string rreason = "G-Lined: " + reason; - for (patricia_tree<User>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) + for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) { User *user = *it; ++it; @@ -683,7 +683,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_ } else { - for (patricia_tree<User>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) + for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) { User *user = *it; ++it; diff --git a/src/servers.cpp b/src/servers.cpp index 3a19adcd1..acd26b4d3 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -86,7 +86,7 @@ Server::~Server() if (Capab.HasFlag(CAPAB_NOQUIT) || Capab.HasFlag(CAPAB_QS)) { - for (patricia_tree<User>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) + for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end;) { User *u = *it; ++it; diff --git a/src/sessions.cpp b/src/sessions.cpp index aa5d1c29b..a90364160 100644 --- a/src/sessions.cpp +++ b/src/sessions.cpp @@ -35,17 +35,12 @@ * or a range thereof. The first exception that the host matches is the one * used. * - * "Session Limiting" is likely to slow down services when there are frequent - * client connects and disconnects. The size of the exception list can also - * play a large role in this performance decrease. It is therefore recommened - * that you keep the number of exceptions to a minimum. - * * -TheShadow (02 April 1999) */ /*************************************************************************/ -patricia_tree<Session> SessionList; +patricia_tree<Session *> SessionList; std::vector<Exception *> exceptions; @@ -58,7 +53,7 @@ void get_session_stats(long &count, long &mem) count = SessionList.size(); mem = sizeof(Session) * SessionList.size(); - for (patricia_tree<Session>::const_iterator it = SessionList.begin(), it_end = SessionList.end(); it != it_end; ++it) + for (patricia_tree<Session *>::const_iterator it = SessionList.begin(), it_end = SessionList.end(); it != it_end; ++it) { Session *session = *it; diff --git a/src/users.cpp b/src/users.cpp index ac16c61ac..58d931789 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -12,8 +12,8 @@ #include "services.h" #include "modules.h" -patricia_tree<User, std::equal_to<ci::string> > UserListByNick; -patricia_tree<User> UserListByUID; +patricia_tree<User *, std::equal_to<ci::string> > UserListByNick; +patricia_tree<User *> UserListByUID; int32 opcnt = 0; uint32 usercnt = 0, maxusercnt = 0; @@ -682,7 +682,7 @@ void get_user_stats(long &count, long &mem) { count = mem = 0; - for (patricia_tree<User>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; ++it) + for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; ++it) { User *user = *it; |