summaryrefslogtreecommitdiff
path: root/src/sessions.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-03-14 20:16:38 -0400
committerAdam <Adam@anope.org>2011-03-14 20:16:38 -0400
commitddfb16de1a61a9b80ece0ba6e5fd34326abf5f18 (patch)
tree81e29e3eebc8ae6241e6bdd6970e48a037291203 /src/sessions.cpp
parent2555d0d6373e631ca2504826a02aaae2e82cd7a4 (diff)
Fixed compile
Diffstat (limited to 'src/sessions.cpp')
-rw-r--r--src/sessions.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sessions.cpp b/src/sessions.cpp
index dcbbff3e6..2be83410c 100644
--- a/src/sessions.cpp
+++ b/src/sessions.cpp
@@ -40,7 +40,7 @@
/*************************************************************************/
-patricia_tree<Session *> SessionList;
+Anope::map<Session *> SessionList;
std::vector<Exception *> exceptions;
@@ -53,10 +53,9 @@ void get_session_stats(long &count, long &mem)
count = SessionList.size();
mem = sizeof(Session) * SessionList.size();
- for (patricia_tree<Session *>::iterator it(SessionList); it.next();)
+ for (Anope::map<Session *>::iterator it = SessionList.begin(), it_end = SessionList.end(); it != it_end; ++it)
{
- Session *session = *it;
-
+ Session *session = it->second;
mem += session->host.length() + 1;
}
}
@@ -84,7 +83,10 @@ void get_exception_stats(long &count, long &mem)
Session *findsession(const Anope::string &host)
{
- return SessionList.find(host);
+ Anope::map<Session *>::iterator it = SessionList.find(host);
+ if (it != SessionList.end())
+ return it->second;
+ return NULL;
}
/* Attempt to add a host to the session list. If the addition of the new host
@@ -149,7 +151,7 @@ void add_session(User *u)
session->count = 1;
session->hits = 0;
- SessionList.insert(session->host, session);
+ SessionList[session->host] = session;
}
}