PartDesign: apply std::ranges
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user