From 860e6cf5cb7d96499aecf6f6067783bdb71c29ad Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:43:52 -0700 Subject: Modernize `std::all_of` with ranges In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed. In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed. --- Source/Core/DiscIO/RiivolutionPatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DiscIO/RiivolutionPatcher.cpp') diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index eff36077f9..9dce9e9a8f 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -104,7 +104,7 @@ FileDataLoaderHostFS::MakeAbsoluteFromRelative(std::string_view external_relativ result.pop_back(); result.pop_back(); } - else if (std::all_of(element.begin(), element.end(), [](char c) { return c == '.'; })) + else if (std::ranges::all_of(element, [](char c) { return c == '.'; })) { // This is a triple, quadruple, etc. dot. // Some file systems treat this as several 'up' path traversals, but Riivolution does not. -- cgit v1.2.3