Part: apply std::ranges

This commit is contained in:
bofdahof
2025-03-12 20:02:29 +10:00
committed by Chris Hennes
parent 965af2bf9a
commit de16fe094a
5 changed files with 27 additions and 34 deletions

View File

@@ -68,16 +68,12 @@ bool BodyBase::isAfter(const App::DocumentObject *feature, const App::DocumentOb
return hasObject (feature);
}
const std::vector<App::DocumentObject *> & features = Group.getValues();
auto featureIt = std::find(features.begin(), features.end(), feature);
auto targetIt = std::find(features.begin(), features.end(), target);
const std::vector<App::DocumentObject*>& features = Group.getValues();
const auto featureIt = std::ranges::find(features, feature);
const auto targetIt = std::ranges::find(features, target);
if (featureIt == features.end()) {
return false;
} else {
return featureIt > targetIt;
}
}
return featureIt == features.end() ? false : featureIt > targetIt;
}
void BodyBase::onBeforeChange (const App::Property* prop) {