diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp index 503307f82..cd7b2075c 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp @@ -144,13 +144,17 @@ void TaskFemConstraintFixed::onSelectionChanged(const Gui::SelectionChanges& msg // Avoid duplicates std::size_t pos = 0; - for (; pos < Objects.size(); pos++) - if (obj == Objects[pos]) + for (; pos < Objects.size(); pos++) { + if (obj == Objects[pos]) { break; + } + } - if (pos != Objects.size()) - if (subName == SubElements[pos]) + if (pos != Objects.size()) { + if (subName == SubElements[pos]) { return; + } + } // add the new reference Objects.push_back(obj); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index df9035c20..38a98183e 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -184,13 +184,17 @@ void TaskFemConstraintForce::onSelectionChanged(const Gui::SelectionChanges& msg // Avoid duplicates std::size_t pos = 0; - for (; pos < Objects.size(); pos++) - if (obj == Objects[pos]) + for (; pos < Objects.size(); pos++) { + if (obj == Objects[pos]) { break; + } + } - if (pos != Objects.size()) - if (subName == SubElements[pos]) + if (pos != Objects.size()) { + if (subName == SubElements[pos]) { return; + } + } // add the new reference Objects.push_back(obj);