2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-07 11:41:57 +00:00

refactor: use std ranges functions where applicable

This commit is contained in:
Jan
2024-03-24 20:49:15 +01:00
parent 132cccb971
commit 239001e6f2
42 changed files with 251 additions and 295 deletions

View File

@ -29,10 +29,9 @@ bool CreateMemberInformationPostProcessor::PostProcess(IDataRepository* reposito
{
const auto& allStructureInformation = repository->GetAllStructureInformation();
return std::all_of(allStructureInformation.begin(),
allStructureInformation.end(),
[this, repository](StructureInformation* structure)
{
return CreateMemberInformationForStructure(repository, structure);
});
return std::ranges::all_of(allStructureInformation,
[this, repository](StructureInformation* structure)
{
return CreateMemberInformationForStructure(repository, structure);
});
}

View File

@ -40,13 +40,12 @@ bool UnionsPostProcessor::PostProcess(IDataRepository* repository)
{
const auto& allInfos = repository->GetAllStructureInformation();
return std::all_of(allInfos.begin(),
allInfos.end(),
[](StructureInformation* info)
{
if (info->m_definition->GetType() != DataDefinitionType::UNION)
return true;
return std::ranges::all_of(allInfos,
[](StructureInformation* info)
{
if (info->m_definition->GetType() != DataDefinitionType::UNION)
return true;
return ProcessUnion(info);
});
return ProcessUnion(info);
});
}

View File

@ -63,11 +63,10 @@ bool UsagesPostProcessor::PostProcess(IDataRepository* repository)
{
const auto& allInfos = repository->GetAllStructureInformation();
return std::all_of(allInfos.begin(),
allInfos.end(),
[](StructureInformation* info)
{
const StructureComputations computations(info);
return !computations.IsAsset() || ProcessAsset(info);
});
return std::ranges::all_of(allInfos,
[](StructureInformation* info)
{
const StructureComputations computations(info);
return !computations.IsAsset() || ProcessAsset(info);
});
}