Simplify std::search with Common::ContainsSubrange

This commit is contained in:
mitaclaw 2024-10-01 11:41:25 -07:00
parent d92c68e1de
commit 527841f1df

View File

@ -144,11 +144,8 @@ RedumpVerifier::DownloadStatus RedumpVerifier::DownloadDatfile(const std::string
if (File::Exists(output_path)) if (File::Exists(output_path))
return DownloadStatus::FailButOldCacheAvailable; return DownloadStatus::FailButOldCacheAvailable;
const std::string system_not_available_message = "System \"" + system + "\" doesn't exist.";
const bool system_not_available_match = const bool system_not_available_match =
result->end() != std::search(result->begin(), result->end(), Common::ContainsSubrange(*result, "System \"" + system + "\" doesn't exist.");
system_not_available_message.begin(),
system_not_available_message.end());
return system_not_available_match ? DownloadStatus::SystemNotAvailable : DownloadStatus::Fail; return system_not_available_match ? DownloadStatus::SystemNotAvailable : DownloadStatus::Fail;
} }