PartDesign: apply std::ranges

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

View File

@@ -204,11 +204,10 @@ void TaskShapeBinder::deleteItem()
PartDesign::ShapeBinder* binder = vp->getObject<PartDesign::ShapeBinder>();
PartDesign::ShapeBinder::getFilteredReferences(&binder->Support, obj, subs);
std::string subname = data.constData();
std::vector<std::string>::iterator it = std::find(subs.begin(), subs.end(), subname);
const std::string subname = data.constData();
// if something was found, delete it and update the support
if (it != subs.end()) {
if (const auto it = std::ranges::find(subs, subname); it != subs.end()) {
subs.erase(it);
binder->Support.setValue(obj, subs);
@@ -317,10 +316,11 @@ bool TaskShapeBinder::referenceSelected(const SelectionChanges& msg) const
if (selectionMode != refObjAdd) {
// ensure the new selected subref belongs to the same object
if (strcmp(msg.pObjectName, obj->getNameInDocument()) != 0)
if (strcmp(msg.pObjectName, obj->getNameInDocument()) != 0) {
return false;
}
std::vector<std::string>::iterator f = std::find(refs.begin(), refs.end(), subName);
const auto f = std::ranges::find(refs, subName);
if (selectionMode == refAdd) {
if (f == refs.end())