aboutsummaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 2288097d0..c74556ad3 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -359,15 +359,9 @@ void CommandParser::ProcessBuffer(LocalUser* user, const std::string& buffer)
ProcessCommand(user, command, parameters);
}
-bool CommandParser::AddCommand(Command *f)
+bool CommandParser::AddCommand(Command* cmd)
{
- /* create the command and push it onto the table */
- if (cmdlist.find(f->name) == cmdlist.end())
- {
- cmdlist[f->name] = f;
- return true;
- }
- return false;
+ return cmdlist.emplace(cmd->name, cmd).second;
}
std::string CommandParser::TranslateUIDs(const std::vector<TranslateType>& to, const CommandBase::Params& source, bool prefix_final, CommandBase* custom_translator)