diff options
| author | JosJuice <josjuice@gmail.com> | 2024-10-15 17:08:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 17:08:55 +0200 |
| commit | 07605bf67c6815510688ebf3e71583624c3bfab0 (patch) | |
| tree | 45d3c7260daf088cbf44febda937f1a4c34c5141 /Source/Core/InputCommon/ControllerInterface | |
| parent | ef8b753cd778179e1c2980b1ec2615f80a314714 (diff) | |
| parent | e572081ac322253d65bf767a88887fedd4e97c2e (diff) | |
Merge pull request #13090 from mitaclaw/ranges-modernization-1-trivial
Ranges Algorithms Modernization - Trivial
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index 577bd761d4..a78c310f24 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -176,15 +176,14 @@ Joystick::Joystick(const LPDIRECTINPUTDEVICE8 device) : m_device(device) std::list<DIDEVICEOBJECTINSTANCE> objects; if (SUCCEEDED(m_device->EnumObjects(DIEnumDeviceObjectsCallback, (LPVOID)&objects, DIDFT_AXIS))) { - const int num_ff_axes = - std::count_if(std::begin(objects), std::end(objects), - [](const auto& pdidoi) { return (pdidoi.dwFlags & DIDOI_FFACTUATOR) != 0; }); + const int num_ff_axes = std::ranges::count_if( + objects, [](const auto& pdidoi) { return (pdidoi.dwFlags & DIDOI_FFACTUATOR) != 0; }); InitForceFeedback(m_device, num_ff_axes); } // Set hats to center: // "The center position is normally reported as -1" -MSDN - std::fill(std::begin(m_state_in.rgdwPOV), std::end(m_state_in.rgdwPOV), -1); + std::ranges::fill(m_state_in.rgdwPOV, -1); } Joystick::~Joystick() diff --git a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp index 4acee6a970..1877e8294c 100644 --- a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp +++ b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp @@ -101,7 +101,7 @@ BuildExpression(const std::vector<ciface::Core::DeviceContainer::InputDetection> } else { - std::sort(alternation.begin(), alternation.end()); + std::ranges::sort(alternation); alternations.push_back(fmt::to_string(fmt::join(alternation, "&"))); } }; @@ -128,7 +128,7 @@ BuildExpression(const std::vector<ciface::Core::DeviceContainer::InputDetection> handle_release(); // Remove duplicates - std::sort(alternations.begin(), alternations.end()); + std::ranges::sort(alternations); alternations.erase(std::unique(alternations.begin(), alternations.end()), alternations.end()); return fmt::to_string(fmt::join(alternations, "|")); |
