]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Fix RemoveCommands to remove all commands (this function had some really odd removal...
[user/henk/code/inspircd.git] / src / command_parse.cpp
index dab7703120895de037b1e57b50f943d5f92de5d9..9e54a63d9b84bfeaccdaf2ebd524b7d7f1e20ef0 100644 (file)
@@ -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)