diff options
| author | JMC47 <JMC4789@gmail.com> | 2024-10-27 19:17:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-27 19:17:01 -0400 |
| commit | 96c9591b9940a72ba00b17d89f6cf2911c923631 (patch) | |
| tree | 4e584dd380367dfe3b8c00e0b932a8ca3f97051b /Source/Core/InputCommon/ControllerEmu/StickGate.cpp | |
| parent | 1b13cc9ca443ba46bf2b0a13366f5f49cbd9505c (diff) | |
| parent | ff6845288e376c4cb60645a96525d8ae63549c8e (diff) | |
Merge pull request #13096 from mitaclaw/ranges-modernization-7-rewrite
Ranges Algorithms Modernization - Rewrite
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/StickGate.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/StickGate.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp index 4edc07fd02..2c82788b99 100644 --- a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp +++ b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp @@ -5,6 +5,7 @@ #include <algorithm> #include <cmath> +#include <ranges> #include <fmt/format.h> #include <fmt/ranges.h> @@ -284,11 +285,10 @@ void ReshapableInput::SaveConfig(Common::IniFile::Section* section, 50.0); } - std::vector<std::string> save_data(m_calibration.size()); - std::transform( - m_calibration.begin(), m_calibration.end(), save_data.begin(), - [](ControlState val) { return fmt::format("{:.2f}", val * CALIBRATION_CONFIG_SCALE); }); - section->Set(group + CALIBRATION_CONFIG_NAME, fmt::to_string(fmt::join(save_data, " ")), ""); + const std::ranges::transform_view scaled_calibration( + m_calibration, [](ControlState val) { return val * CALIBRATION_CONFIG_SCALE; }); + section->Set(group + CALIBRATION_CONFIG_NAME, + fmt::format("{:.2f}", fmt::join(scaled_calibration, " ")), ""); // Save center value. static constexpr char center_format[] = "{:.2f} {:.2f}"; |
