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

This commit is contained in:
wmayer
2023-08-15 17:28:50 +02:00
committed by Chris Hennes
parent 9a1f8a11d6
commit 312975edba
49 changed files with 364 additions and 365 deletions

View File

@@ -47,8 +47,8 @@ BodyBase* BodyBase::findBodyOf(const App::DocumentObject* f)
App::Document* doc = f->getDocument();
if (doc) {
std::vector<App::DocumentObject*> bodies = doc->getObjectsOfType(BodyBase::getClassTypeId());
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++) {
BodyBase* body = static_cast<BodyBase*>(*b);
for (auto it : bodies) {
BodyBase* body = static_cast<BodyBase*>(it);
if (body->hasObject(f))
return body;
}