mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -862,10 +862,7 @@ static std::vector<u8> ExtractNodeToVector(std::vector<FSTBuilderNode>* nodes, v
|
||||
DirectoryBlobReader* blob)
|
||||
{
|
||||
std::vector<u8> data;
|
||||
const auto it =
|
||||
std::find_if(nodes->begin(), nodes->end(), [&userdata](const FSTBuilderNode& node) {
|
||||
return node.m_user_data == userdata;
|
||||
});
|
||||
const auto it = std::ranges::find(*nodes, userdata, &FSTBuilderNode::m_user_data);
|
||||
if (it == nodes->end() || !it->IsFile())
|
||||
return data;
|
||||
|
||||
|
Reference in New Issue
Block a user