Permalink
Browse files

Merge pull request #7029 from lioncash/any

VolumeWii: Shorten padding checking code within CheckIntegrity()
  • Loading branch information...
leoetlino committed May 30, 2018
2 parents 4fb2d58 + f845818 commit b7a268ceea8e8f03e0361739850c44afb2d39901
Showing with 3 additions and 4 deletions.
  1. +3 −4 Source/Core/DiscIO/VolumeWii.cpp
@@ -424,10 +424,9 @@ bool VolumeWii::CheckIntegrity(const Partition& partition) const
// This may cause some false negatives though: some bad clusters may be
// skipped because they are *too* bad and are not even recognized as
// valid clusters. To be improved.
bool meaningless = false;
for (u32 idx = 0x26C; idx < 0x280; ++idx)
if (cluster_metadata[idx] != 0)
meaningless = true;
const u8* pad_begin = cluster_metadata + 0x26C;
const u8* pad_end = pad_begin + 0x14;
const bool meaningless = std::any_of(pad_begin, pad_end, [](u8 val) { return val != 0; });
if (meaningless)
continue;

0 comments on commit b7a268c

Please sign in to comment.