VideoCommon/OnScreenDisplay: Take Message's std::string parameter by value

Allows callers to std::move strings into the functions (or automatically
assume the move constructor/move assignment operator for rvalue
references, potentially avoiding copies altogether.
This commit is contained in:
Lioncash
2019-07-28 22:46:08 -04:00
parent 50b240fcbd
commit c212310fbe
7 changed files with 18 additions and 17 deletions

View File

@ -150,7 +150,7 @@ std::string StopMessage(bool main_thread, const std::string& message)
Common::CurrentThreadId(), message.c_str());
}
void DisplayMessage(const std::string& message, int time_in_ms)
void DisplayMessage(std::string message, int time_in_ms)
{
if (!IsRunning())
return;
@ -162,8 +162,8 @@ void DisplayMessage(const std::string& message, int time_in_ms)
return;
}
OSD::AddMessage(message, time_in_ms);
Host_UpdateTitle(message);
OSD::AddMessage(std::move(message), time_in_ms);
}
bool IsRunning()