diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-29 11:43:52 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-12-15 19:50:34 -0800 |
| commit | 860e6cf5cb7d96499aecf6f6067783bdb71c29ad (patch) | |
| tree | 212a451cbdd72d6525703c2f1369198fbdbe2b85 /Source/Core/DiscIO/DiscUtils.cpp | |
| parent | 826e2bbf98ca5c6088c3d19968272b29fc335972 (diff) | |
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.
Diffstat (limited to 'Source/Core/DiscIO/DiscUtils.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DiscUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/DiscUtils.cpp b/Source/Core/DiscIO/DiscUtils.cpp index 5d03a5aa7f..8564e8c017 100644 --- a/Source/Core/DiscIO/DiscUtils.cpp +++ b/Source/Core/DiscIO/DiscUtils.cpp @@ -40,7 +40,7 @@ std::string NameForPartitionType(u32 partition_type, bool include_prefix) static_cast<char>((partition_type >> 16) & 0xFF), static_cast<char>((partition_type >> 8) & 0xFF), static_cast<char>(partition_type & 0xFF)}; - if (std::all_of(type_as_game_id.cbegin(), type_as_game_id.cend(), Common::IsAlnum)) + if (std::ranges::all_of(type_as_game_id, Common::IsAlnum)) { return include_prefix ? "P-" + type_as_game_id : type_as_game_id; } |
