diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-20 22:17:29 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2025-01-01 09:52:03 -0800 |
| commit | 110d32729ecbe5b19df9b2cc76de630334410589 (patch) | |
| tree | 0032af6f60d1b8575bc5bfcbefb8c3faa951d96f /Source/Core/DiscIO/VolumeVerifier.cpp | |
| parent | 6f10acea3fee4d08c4e52e66f862da45ad06d1ed (diff) | |
Simplify `std::find` with `Common::Contains`
In NandPaths.cpp, the `std::initializer_list<char>` of illegal characters has been turned into a `char[]` (similar to the one in GameList.cpp).
The reverse iteration in ResourcePack.cpp seemed to provide no benefits, and doing without it it seemed to have no ill effects.
Diffstat (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 552b20cfb4..35b0b5670d 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -21,6 +21,7 @@ #include "Common/CPUDetect.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" +#include "Common/Contains.h" #include "Common/Crypto/SHA1.h" #include "Common/FileUtil.h" #include "Common/Hash.h" @@ -453,21 +454,18 @@ std::vector<Partition> VolumeVerifier::CheckPartitions() types.emplace_back(*type); } - if (std::find(types.cbegin(), types.cend(), PARTITION_UPDATE) == types.cend()) + if (!Common::Contains(types, PARTITION_UPDATE)) AddProblem(Severity::Low, Common::GetStringT("The update partition is missing.")); - const bool has_data_partition = - std::find(types.cbegin(), types.cend(), PARTITION_DATA) != types.cend(); + const bool has_data_partition = Common::Contains(types, PARTITION_DATA); if (!m_is_datel && !has_data_partition) AddProblem(Severity::High, Common::GetStringT("The data partition is missing.")); - const bool has_channel_partition = - std::find(types.cbegin(), types.cend(), PARTITION_CHANNEL) != types.cend(); + const bool has_channel_partition = Common::Contains(types, PARTITION_CHANNEL); if (ShouldHaveChannelPartition() && !has_channel_partition) AddProblem(Severity::Medium, Common::GetStringT("The channel partition is missing.")); - const bool has_install_partition = - std::find(types.cbegin(), types.cend(), PARTITION_INSTALL) != types.cend(); + const bool has_install_partition = Common::Contains(types, PARTITION_INSTALL); if (ShouldHaveInstallPartition() && !has_install_partition) AddProblem(Severity::High, Common::GetStringT("The install partition is missing.")); |
