summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-28 21:26:22 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-28 21:26:22 +0000
commit25d1c9c176be31458ffc264d5b6e7ccdd8660717 (patch)
tree0d86195009e14f8f3737b86acbe34f19b6560967
parent68745b98f5d556a9c155e0514c099cdcc79c0a5b (diff)
Changed some other stuff that used the old vector/deque style commandlist
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2687 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/cmd_commands.cpp4
-rw-r--r--src/cmd_stats.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd_commands.cpp b/src/cmd_commands.cpp
index 6ad8ae8b0..961c8db88 100644
--- a/src/cmd_commands.cpp
+++ b/src/cmd_commands.cpp
@@ -47,9 +47,9 @@ extern InspIRCd* ServerInstance;
void cmd_commands::Handle (char **parameters, int pcnt, userrec *user)
{
- for (unsigned int i = 0; i < ServerInstance->Parser->cmdlist.size(); i++)
+ for (nspace::hash_map<std::string,command_t*>::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
{
- WriteServ(user->fd,"902 %s :%s %s %d",user->nick,ServerInstance->Parser->cmdlist[i]->command.c_str(),ServerInstance->Parser->cmdlist[i]->source.c_str(),ServerInstance->Parser->cmdlist[i]->min_params);
+ WriteServ(user->fd,"902 %s :%s %s %d",user->nick,i->second->command.c_str(),i->second->source.c_str(),i->second->min_params);
}
WriteServ(user->fd,"903 %s :End of COMMANDS list",user->nick);
}
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp
index 4a7547a3a..2d45aa873 100644
--- a/src/cmd_stats.cpp
+++ b/src/cmd_stats.cpp
@@ -164,12 +164,12 @@ void cmd_stats::Handle (char **parameters, int pcnt, userrec *user)
/* stats m (list number of times each command has been used, plus bytecount) */
if (*parameters[0] == 'm')
{
- for (unsigned int i = 0; i < ServerInstance->Parser->cmdlist.size(); i++)
+ for (nspace::hash_map<std::string,command_t*>::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
{
- if (ServerInstance->Parser->cmdlist[i]->use_count)
+ if (i->second->use_count)
{
/* RPL_STATSCOMMANDS */
- WriteServ(user->fd,"212 %s %s %d %d",user->nick,ServerInstance->Parser->cmdlist[i]->command.c_str(),ServerInstance->Parser->cmdlist[i]->use_count,ServerInstance->Parser->cmdlist[i]->total_bytes);
+ WriteServ(user->fd,"212 %s %s %d %d",user->nick,i->second->command.c_str(),i->second->use_count,i->second->total_bytes);
}
}