diff options
| author | David Korth <gerbilsoft@gerbilsoft.com> | 2019-09-24 00:24:56 -0400 |
|---|---|---|
| committer | David Korth <gerbilsoft@gerbilsoft.com> | 2019-12-29 23:42:55 -0500 |
| commit | afe2e7de0f83552c1c2235bfcdb993cd6be23c2b (patch) | |
| tree | 7eab73ced8d8ed469c9d4ef1fd98b90bf6287268 /Source/Core | |
| parent | d660aba20fae070a51e01936aa32044d31a96df7 (diff) | |
VolumeVerifier.cpp: Verify that the string arrays are sorted before using std::binary_sort().
Debug builds only, since this is wrapped in assert().
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 0634e34b66..15d53f62a1 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -5,6 +5,7 @@ #include "DiscIO/VolumeVerifier.h" #include <algorithm> +#include <cassert> #include <cinttypes> #include <future> #include <limits> @@ -682,6 +683,7 @@ bool VolumeVerifier::ShouldHaveChannelPartition() const "RFNE01", "RFNJ01", "RFNK01", "RFNP01", "RFNW01", "RFPE01", "RFPJ01", "RFPK01", "RFPP01", "RFPW01", "RGWE41", "RGWJ41", "RGWP41", "RGWX41", "RMCE01", "RMCJ01", "RMCK01", "RMCP01", }; + assert(std::is_sorted(channel_discs.cbegin(), channel_discs.cend())); return std::binary_search(channel_discs.cbegin(), channel_discs.cend(), std::string_view(m_volume.GetGameID())); @@ -714,6 +716,7 @@ bool VolumeVerifier::ShouldBeDualLayer() const "SLSEXJ", "SLSP01", "SQIE4Q", "SQIP4Q", "SQIY4Q", "SR5E41", "SR5P41", "SUOE41", "SUOP41", "SVXX52", "SVXY52", "SX4E01", "SX4P01", "SZ3EGT", "SZ3PGT", }; + assert(std::is_sorted(dual_layer_discs.cbegin(), dual_layer_discs.cend())); return std::binary_search(dual_layer_discs.cbegin(), dual_layer_discs.cend(), std::string_view(m_volume.GetGameID())); |
