summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/command_parse.h3
-rw-r--r--src/command_parse.cpp15
2 files changed, 4 insertions, 14 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index fea8bd869..858c1c8e6 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -180,9 +180,8 @@ class CoreExport CommandParser : public classbase
/** Remove all commands relating to module 'source'.
* @param source A module name which has introduced new commands
- * @return True This function returns true if commands were removed
*/
- bool RemoveCommands(const char* source);
+ void RemoveCommands(const char* source);
/** Add a new command to the commands hash
* @param f The new Command to add to the list
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index dab770312..9e54a63d9 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -367,24 +367,15 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
}
}
-bool CommandParser::RemoveCommands(const char* source)
+void CommandParser::RemoveCommands(const char* source)
{
Commandable::iterator i,safei;
- for (i = cmdlist.begin(); i != cmdlist.end(); i++)
+ for (i = cmdlist.begin(); i != cmdlist.end();)
{
safei = i;
- safei++;
- if (safei != cmdlist.end())
- {
- RemoveCommand(safei, source);
- }
- }
- safei = cmdlist.begin();
- if (safei != cmdlist.end())
- {
+ i++;
RemoveCommand(safei, source);
}
- return true;
}
void CommandParser::RemoveCommand(Commandable::iterator safei, const char* source)