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/VolumeWad.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index bc75e71b88..61848a4218 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -176,7 +176,7 @@ IOS::ES::TicketReader VolumeWAD::GetTicketWithFixedCommonKey() const return m_ticket; const std::vector sig = m_ticket.GetSignatureData(); - if (!std::all_of(sig.cbegin(), sig.cend(), [](u8 a) { return a == 0; })) + if (!std::ranges::all_of(sig, [](u8 a) { return a == 0; })) { // This does not look like a typical "invalid common key index" ticket, so let's assume // the index is correct. This saves some time when reading properly signed titles. -- cgit v1.2.3