Simplify std::find_if with std::ranges::find and projections

In LabelMap.cpp, the code is currently unused so I was unable to test it.

In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`.
This commit is contained in:
mitaclaw
2024-09-21 14:43:21 -07:00
parent 1e5e9219cd
commit 62b2b939b5
20 changed files with 44 additions and 79 deletions

View File

@ -148,9 +148,8 @@ bool UI::IsTestMode()
bool Platform::VersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
const std::string& install_base_path, const std::string& temp_dir)
{
const auto op_it = std::find_if(to_update.cbegin(), to_update.cend(), [&](const auto& op) {
return op.filename == "Dolphin.app/Contents/Info.plist";
});
const auto op_it = std::ranges::find(to_update, "Dolphin.app/Contents/Info.plist",
&TodoList::UpdateOp::filename);
if (op_it == to_update.cend())
return true;