hack.cpp: optimize hack::ExecuteCommand a little

Pass reference to std::string instead of std::string copy
This commit is contained in:
Unnamed 2019-02-22 17:28:32 +00:00 committed by TotallyNotElite
parent bc8229041d
commit e8138bb26b
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ namespace hack
extern std::mutex command_stack_mutex;
std::stack<std::string> &command_stack();
void ExecuteCommand(const std::string command);
void ExecuteCommand(const std::string &command);
extern bool game_shutdown;
extern bool shutdown;

View File

@ -94,7 +94,7 @@ std::stack<std::string> &hack::command_stack()
return stack;
}
void hack::ExecuteCommand(const std::string command)
void hack::ExecuteCommand(const std::string &command)
{
std::lock_guard<std::mutex> guard(hack::command_stack_mutex);
hack::command_stack().push(command);