]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix RemoveCommands to remove all commands (this function had some really odd removal...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 20 Apr 2008 18:58:59 +0000 (18:58 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 20 Apr 2008 18:58:59 +0000 (18:58 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9554 e03df62e-2008-0410-955e-edbf42e46eb7

include/command_parse.h
src/command_parse.cpp

index fea8bd869738ecb496db1a0c87895aa9e2a44963..858c1c8e654af07e4d7942a944c1fa4fb8fc34c0 100644 (file)
@@ -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
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)