mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
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:
@ -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()
|
||||
|
Reference in New Issue
Block a user