Skip to content
Permalink
Browse files

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.
  • Loading branch information
lioncash committed Nov 22, 2019
1 parent 278d03f commit db9e59276556d1797d4a9b939434e4dbd8f86e40
@@ -200,7 +200,7 @@ static void HotplugThreadFunc()
{
const bool port_changed = !IsSameController(*port_info, s_port_info[port_info->pad_id]);
{
std::lock_guard<std::mutex> 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<std::mutex> 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];

0 comments on commit db9e592

Please sign in to comment.
You can’t perform that action at this time.