summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeVerifier.cpp
diff options
context:
space:
mode:
authormitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-09-30 17:26:50 -0700
committermitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-12-15 19:54:16 -0800
commit140252ffc0ae71e8b5309bff7d6550189c602702 (patch)
tree7e6fe317fc93e0d9fc91e089ec3af86af25565f1 /Source/Core/DiscIO/VolumeVerifier.cpp
parent860e6cf5cb7d96499aecf6f6067783bdb71c29ad (diff)
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.
Diffstat (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeVerifier.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp
index d510aa3266..552b20cfb4 100644
--- a/Source/Core/DiscIO/VolumeVerifier.cpp
+++ b/Source/Core/DiscIO/VolumeVerifier.cpp
@@ -729,16 +729,15 @@ bool VolumeVerifier::ShouldHaveInstallPartition() const
static constexpr std::array<std::string_view, 4> dragon_quest_x = {"S4MJGD", "S4SJGD", "S6TJGD",
"SDQJGD"};
const std::string& game_id = m_volume.GetGameID();
- return std::any_of(dragon_quest_x.cbegin(), dragon_quest_x.cend(),
- [&game_id](std::string_view x) { return x == game_id; });
+ return std::ranges::any_of(dragon_quest_x,
+ [&game_id](std::string_view x) { return x == game_id; });
}
bool VolumeVerifier::ShouldHaveMasterpiecePartitions() const
{
static constexpr std::array<std::string_view, 4> ssbb = {"RSBE01", "RSBJ01", "RSBK01", "RSBP01"};
const std::string& game_id = m_volume.GetGameID();
- return std::any_of(ssbb.cbegin(), ssbb.cend(),
- [&game_id](std::string_view x) { return x == game_id; });
+ return std::ranges::any_of(ssbb, [&game_id](std::string_view x) { return x == game_id; });
}
bool VolumeVerifier::ShouldBeDualLayer() const
@@ -1039,7 +1038,7 @@ void VolumeVerifier::CheckSuperPaperMario()
if (!m_volume.Read(offset, length, data.data(), partition))
return;
- if (std::any_of(data.cbegin(), data.cend(), [](u8 x) { return x != 0; }))
+ if (std::ranges::any_of(data, [](u8 x) { return x != 0; }))
{
AddProblem(Severity::High,
Common::GetStringT("Some padding data that should be zero is not zero. "