]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Removal of ancient TRUE/FALSE #defines (C-ish stuff)
[user/henk/code/inspircd.git] / src / command_parse.cpp
index 00eaf29c4015166667c87180e6d0af2b9cf2e751..e81595ac4f88be4c4347a712b0ec84e1da72efb1 100644 (file)
@@ -307,7 +307,7 @@ int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec
        return 1;
 }
 
-bool CommandParser::IsValidCommand(std::string &commandname, int pcnt, userrec * user)
+bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, userrec * user)
 {
        nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
 
@@ -319,27 +319,18 @@ bool CommandParser::IsValidCommand(std::string &commandname, int pcnt, userrec *
                        {
                                if (n->second->flags_needed)
                                {
-                                       if ((user->HasPermission(commandname)) || (is_uline(user->server)))
-                                       {
-                                               return true;
-                                       }
-                                       else
-                                       {
-                                               return false;
-                                       }
+                                       return ((user->HasPermission(commandname)) || (is_uline(user->server)));
                                }
-
                                return true;
                        }
                }
        }
-
        return false;
 }
 
 // calls a handler function for a command
 
-bool CommandParser::CallHandler(std::string &commandname,char **parameters, int pcnt, userrec *user)
+bool CommandParser::CallHandler(const std::string &commandname,char **parameters, int pcnt, userrec *user)
 {
        nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);