diff options
| author | Adam <Adam@drink-coca-cola.info> | 2010-05-14 20:35:38 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-06-18 21:01:53 -0400 |
| commit | f049124905bd9f53439293e873003cb027a17b91 (patch) | |
| tree | 352ed9251fd47055dd770aa2d5eabb20247e4b43 /src/core/os_session.c | |
| parent | 81a45520a773732c9f46785f27aa1956150775d7 (diff) | |
Rewrote the hashing system to use std::tr1::unordered_map
Diffstat (limited to 'src/core/os_session.c')
| -rw-r--r-- | src/core/os_session.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/os_session.c b/src/core/os_session.c index f450cf6a1..2f272ab1a 100644 --- a/src/core/os_session.c +++ b/src/core/os_session.c @@ -19,8 +19,7 @@ class CommandOSSession : public Command private: CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { - Session *session; - int mincount, i; + int mincount; const char *param = params[1].c_str(); if ((mincount = atoi(param)) <= 1) @@ -29,13 +28,13 @@ class CommandOSSession : public Command { notice_lang(Config.s_OperServ, u, OPER_SESSION_LIST_HEADER, mincount); notice_lang(Config.s_OperServ, u, OPER_SESSION_LIST_COLHEAD); - for (i = 0; i < 1024; ++i) + + for (session_map::const_iterator it = SessionList.begin(); it != SessionList.end(); ++it) { - for (session = sessionlist[i]; session; session = session->next) - { - if (session->count >= mincount) - notice_lang(Config.s_OperServ, u, OPER_SESSION_LIST_FORMAT, session->count, session->host); - } + Session *session = it->second; + + if (session->count >= mincount) + notice_lang(Config.s_OperServ, u, OPER_SESSION_LIST_FORMAT, session->count, session->host); } } @@ -460,8 +459,8 @@ class OSSession : public Module this->SetVersion(VERSION_STRING); this->SetType(CORE); - this->AddCommand(OPERSERV, new CommandOSSession()); - this->AddCommand(OPERSERV, new CommandOSException()); + this->AddCommand(OperServ, new CommandOSSession()); + this->AddCommand(OperServ, new CommandOSException()); ModuleManager::Attach(I_OnOperServHelp, this); } |
