diff options
| author | JMC47 <JMC4789@gmail.com> | 2024-12-26 16:51:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-26 16:51:53 -0500 |
| commit | 532a8621daa5c0d8a3a55f64ffba9cb20209d455 (patch) | |
| tree | 21837ec63b1fe4a45a162a1f1bf4167efcd4d177 /Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | |
| parent | f9ce2b9d764014ab59cf2c19e49c2c848604e6fc (diff) | |
| parent | 2b0cd16c8c266bc1e298e49d4009eab8c9c23f99 (diff) | |
Merge pull request #13116 from mitaclaw/ranges-modernization-8-trivial-of
Ranges Algorithms Modernization - Of
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index 769e6c5f0e..10dd492ceb 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -248,7 +248,7 @@ bool ControllerInterface::AddDevice(std::shared_ptr<ciface::Core::Device> device std::lock_guard lk(m_devices_mutex); const auto is_id_in_use = [&device, this](int id) { - return std::any_of(m_devices.begin(), m_devices.end(), [&device, &id](const auto& d) { + return std::ranges::any_of(m_devices, [&device, &id](const auto& d) { return d->GetSource() == device->GetSource() && d->GetName() == device->GetName() && d->GetId() == id; }); @@ -368,10 +368,8 @@ void ControllerInterface::UpdateInput() if (devices_to_remove.size() > 0) { RemoveDevice([&](const ciface::Core::Device* device) { - return std::any_of(devices_to_remove.begin(), devices_to_remove.end(), - [device](const std::weak_ptr<ciface::Core::Device>& d) { - return d.lock().get() == device; - }); + return std::ranges::any_of(devices_to_remove, + [device](const auto& d) { return d.lock().get() == device; }); }); } } |
