HID: optimize get_next_button_press a bit

This commit is contained in:
Megamouse 2022-06-05 15:58:05 +02:00
parent 09875a5180
commit bb03e17e2d
2 changed files with 12 additions and 13 deletions

View file

@ -217,12 +217,9 @@ std::shared_ptr<Device> hid_pad_handler<Device>::get_hid_device(const std::strin
return nullptr;
// Controllers 1-n in GUI
for (auto& cur_control : m_controllers)
if (auto it = m_controllers.find(padId); it != m_controllers.end())
{
if (padId == cur_control.first)
{
return cur_control.second;
}
return it->second;
}
return nullptr;