PD: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-15 17:30:08 +02:00
committed by Chris Hennes
parent 8c25886da2
commit 3e09b8ee2d
30 changed files with 126 additions and 132 deletions

View File

@@ -194,9 +194,9 @@ QVariant TaskSketchBasedParameters::objectNameByLabel(const QString& label,
// go through all objects and check the labels
std::string name = label.toUtf8().data();
std::vector<App::DocumentObject*> objs = doc->getObjects();
for (std::vector<App::DocumentObject*>::iterator it = objs.begin(); it != objs.end(); ++it) {
if (name == (*it)->Label.getValue()) {
return QVariant(QByteArray((*it)->getNameInDocument()));
for (auto obj : objs) {
if (name == obj->Label.getValue()) {
return QVariant(QByteArray(obj->getNameInDocument()));
}
}