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/Common/FileSearch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/Common/FileSearch.cpp') diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index 4a54c978c9..a92c50f7d1 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -98,7 +98,8 @@ std::vector DoFileSearch(const std::vector& directorie // not because std::filesystem returns duplicates). Also note that this pathname-based uniqueness // isn't as thorough as std::filesystem::equivalent. std::ranges::sort(result); - result.erase(std::unique(result.begin(), result.end()), result.end()); + const auto unique_result = std::ranges::unique(result); + result.erase(unique_result.begin(), unique_result.end()); // Dolphin expects to be able to use "/" (DIR_SEP) everywhere. // std::filesystem uses the OS separator. -- cgit v1.2.3