From 140252ffc0ae71e8b5309bff7d6550189c602702 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:26:50 -0700 Subject: Modernize `std::any_of` with ranges In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates. --- Source/Core/Common/FileSearch.cpp | 2 +- 1 file changed, 1 insertion(+), 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..ac82b9ebd6 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -41,7 +41,7 @@ std::vector DoFileSearch(const std::vector& directorie // N.B. This avoids doing any copies auto ext_matches = [&native_exts](const fs::path& path) { const std::basic_string_view native_path = path.native(); - return std::any_of(native_exts.cbegin(), native_exts.cend(), [&native_path](const auto& ext) { + return std::ranges::any_of(native_exts, [&native_path](const auto& ext) { const auto compare_len = ext.native().length(); if (native_path.length() < compare_len) return false; -- cgit v1.2.3