summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWii.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-05-30 08:35:00 -0400
committerLioncash <mathew1800@gmail.com>2018-05-30 08:42:32 -0400
commitf845818cfe864fa2dd0525112e9ffb3e93763774 (patch)
tree164ffcb8cb8e989c158a61e01e29e282b85844f1 /Source/Core/DiscIO/VolumeWii.cpp
parent4fb2d580d8c7dd37cd9f24e6db5d98668d325383 (diff)
VolumeWii: Shorten padding checking code within CheckIntegrity()
We can just use std::any_of here to collapse the checking code down to a single assignment as opposed to a loop. This also slightly improves on the existing code, as this won't continue to iterate through the cluster metadata if an entry that's non-zero is encountered.
Diffstat (limited to 'Source/Core/DiscIO/VolumeWii.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWii.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp
index 5d9d4b3983..73e5b290b7 100644
--- a/Source/Core/DiscIO/VolumeWii.cpp
+++ b/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;