From db9e59276556d1797d4a9b939434e4dbd8f86e40 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 22 Nov 2019 16:20:48 -0500 Subject: [PATCH] InputCommon/DualShockUDPClient: Use deduction guides for lock_guard With C++17, we can use template deduction guides provided by the standard library. This allows the omission of the mutex type itself. --- .../DualShockUDPClient/DualShockUDPClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp index 6183b69049..6595a0193b 100644 --- a/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.cpp @@ -200,7 +200,7 @@ static void HotplugThreadFunc() { const bool port_changed = !IsSameController(*port_info, s_port_info[port_info->pad_id]); { - std::lock_guard lock(s_port_info_mutex); + std::lock_guard lock{s_port_info_mutex}; s_port_info[port_info->pad_id] = *port_info; } if (port_changed) @@ -283,7 +283,7 @@ void PopulateDevices() g_controller_interface.RemoveDevice( [](const auto* dev) { return dev->GetSource() == "DSUClient"; }); - std::lock_guard lock(s_port_info_mutex); + std::lock_guard lock{s_port_info_mutex}; for (size_t port_index = 0; port_index < s_port_info.size(); port_index++) { const Proto::MessageType::PortInfo& port_info = s_port_info[port_index];