mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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.
This commit is contained in:
@ -176,7 +176,7 @@ IOS::ES::TicketReader VolumeWAD::GetTicketWithFixedCommonKey() const
|
||||
return m_ticket;
|
||||
|
||||
const std::vector<u8> 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.
|
||||
|
Reference in New Issue
Block a user