PartDesign: apply std::ranges

This commit is contained in:
bofdahof
2025-03-12 20:01:50 +10:00
committed by Chris Hennes
parent beb5dd9629
commit 216a76e971
13 changed files with 60 additions and 71 deletions

View File

@@ -214,11 +214,11 @@ bool TaskLoftParameters::referenceSelected(const Gui::SelectionChanges& msg) con
loft->Profile.setValue(obj, {msg.pSubName});
return true;
}
else if (selectionMode == refAdd || selectionMode == refRemove) {
if (selectionMode == refAdd || selectionMode == refRemove) {
// now check the sections
std::vector<App::DocumentObject*> refs = loft->Sections.getValues();
std::vector<App::DocumentObject*>::iterator f =
std::find(refs.begin(), refs.end(), obj);
const auto f = std::ranges::find(refs, obj);
if (selectionMode == refAdd) {
if (f != refs.end()) {
@@ -266,12 +266,10 @@ void TaskLoftParameters::onDeleteSection()
delete item;
// search inside the list of sections
if (auto loft = getObject<PartDesign::Loft>()) {
if (const auto loft = getObject<PartDesign::Loft>()) {
std::vector<App::DocumentObject*> refs = loft->Sections.getValues();
App::DocumentObject* obj = loft->getDocument()->getObject(data.constData());
std::vector<App::DocumentObject*>::iterator f =
std::find(refs.begin(), refs.end(), obj);
if (f != refs.end()) {
if (const auto f = std::ranges::find(refs, obj); f != refs.end()) {
loft->Sections.removeValue(obj);
recomputeFeature();