hack.cpp: optimize hack::ExecuteCommand a little
Pass reference to std::string instead of std::string copy
This commit is contained in:
parent
bc8229041d
commit
e8138bb26b
@ -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;
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user