From 5f3a8ff0de9d89ec162e1d2be7611b10f3d3740f Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:19:03 -0700 Subject: Modernize `std::unique` with ranges The new return value is `std::ranges::subrange`. --- Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp index 1877e8294c..b50621bc92 100644 --- a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp +++ b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp @@ -129,7 +129,8 @@ BuildExpression(const std::vector // Remove duplicates std::ranges::sort(alternations); - alternations.erase(std::unique(alternations.begin(), alternations.end()), alternations.end()); + const auto unique_result = std::ranges::unique(alternations); + alternations.erase(unique_result.begin(), unique_result.end()); return fmt::to_string(fmt::join(alternations, "|")); } -- cgit v1.2.3