FEM: apply std::ranges

This commit is contained in:
bofdahof
2025-03-12 17:48:04 +10:00
committed by Chris Hennes
parent fbd195ccf2
commit 1c4ecf576b
17 changed files with 44 additions and 93 deletions

View File

@@ -147,9 +147,7 @@ void TaskFemConstraintSpring::addToSelection()
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
for (std::vector<std::string>::iterator itr =
std::find(SubElements.begin(), SubElements.end(), subName);
itr != SubElements.end();
for (auto itr = std::ranges::find(SubElements, subName); itr != SubElements.end();
itr = std::find(++itr,
SubElements.end(),
subName)) { // for every sub element in selection that
@@ -196,9 +194,7 @@ void TaskFemConstraintSpring::removeFromSelection()
const App::DocumentObject* obj = it.getObject();
for (const auto& subName : subNames) { // for every selected sub element
for (std::vector<std::string>::iterator itr =
std::find(SubElements.begin(), SubElements.end(), subName);
itr != SubElements.end();
for (auto itr = std::ranges::find(SubElements, subName); itr != SubElements.end();
itr = std::find(++itr,
SubElements.end(),
subName)) { // for every sub element in selection that