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

@@ -404,19 +404,18 @@ void TaskExtrudeParameters::selectedShapeFace(const Gui::SelectionChanges& msg)
}
std::vector<std::string> faces = getShapeFaces();
std::string subName(msg.pSubName);
const std::string subName(msg.pSubName);
if (subName.empty()) {
return;
}
auto positionInList = std::find(faces.begin(), faces.end(), subName);
if (positionInList != faces.end()) { // If it's found then it's in the list so we remove it.
faces.erase(positionInList);
if (const auto positionInList = std::ranges::find(faces, subName);
positionInList != faces.end()) { // it's in the list
faces.erase(positionInList); // remove it.
}
else { // if it's not found then it's not yet in the list so we add it.
faces.push_back(subName);
else {
faces.push_back(subName); // not yet in the list so add it.
}
extrude->UpToShape.setValue(base, faces);