diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-22 10:04:35 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-22 10:13:06 +0000 |
commit | ec66b397b00b32a3b02e9b68c2c9b1017e699572 (patch) | |
tree | c2b523a3aca609756e01dca2ec194bb2aa237302 | |
parent | a8b8cfe99e42cb0987594f160be11d0c9cc7866e (diff) |
Remove unnecessary copies of CommandBase::Params in LoopCall.
-rw-r--r-- | src/command_parse.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 706566199..6b6ae0079 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -80,29 +80,28 @@ bool CommandParser::LoopCall(User* user, Command* handler, const CommandBase::Pa * for every parameter or parameter pair until there are no more * left to parse. */ + CommandBase::Params splitparams(parameters); while (items1.GetToken(item) && (!usemax || max++ < ServerInstance->Config->MaxTargets)) { if ((!check_dupes) || (dupes.insert(item).second)) { - CommandBase::Params new_parameters(parameters); - new_parameters[splithere] = item; + splitparams[splithere] = item; if (extra >= 0) { // If we have two lists then get the next item from the second list. // In case it runs out of elements then 'item' will be an empty string. items2.GetToken(item); - new_parameters[extra] = item; + splitparams[extra] = item; } - CommandBase::Params params(new_parameters, parameters.GetTags()); - CmdResult result = handler->Handle(user, params); + CmdResult result = handler->Handle(user, splitparams); if (localuser) { // Run the OnPostCommand hook with the last parameter being true to indicate // that the event is being called in a loop. item.clear(); - FOREACH_MOD(OnPostCommand, (handler, new_parameters, localuser, result, true)); + FOREACH_MOD(OnPostCommand, (handler, splitparams, localuser, result, true)); } } } |