mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Core: Make use of C++17 deduction guides with locks
C++17 allows omitting the mutex type, which makes for both less reading and more flexibility (e.g. The mutex type can change and all occurrences don't need to be updated).
This commit is contained in:
@ -169,7 +169,7 @@ std::string GetInputDisplay()
|
||||
|
||||
std::string input_display;
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_input_display_lock);
|
||||
std::lock_guard guard(s_input_display_lock);
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
if ((s_controllers & (1 << i)) != 0)
|
||||
@ -634,7 +634,7 @@ static void SetInputDisplayString(ControllerState padState, int controllerID)
|
||||
display_str += " DISCONNECTED";
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> guard(s_input_display_lock);
|
||||
std::lock_guard guard(s_input_display_lock);
|
||||
s_InputDisplay[controllerID] = std::move(display_str);
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@ static void SetWiiInputDisplayString(int remoteID, const DataReportBuilder& rpt,
|
||||
display_str += Analog2DToString(right_stick.x, right_stick.y, " R-ANA", 31);
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> guard(s_input_display_lock);
|
||||
std::lock_guard guard(s_input_display_lock);
|
||||
s_InputDisplay[controllerID] = std::move(display_str);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user