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

This commit is contained in:
wmayer
2023-08-14 16:37:45 +02:00
committed by wwmayer
parent 367cdb36ed
commit 26f16f7410
22 changed files with 422 additions and 418 deletions

View File

@@ -268,9 +268,9 @@ std::vector<DocumentObject*> GroupExtension::getObjectsOfType(const Base::Type&
{
std::vector<DocumentObject*> type;
const std::vector<DocumentObject*>& grp = Group.getValues();
for (std::vector<DocumentObject*>::const_iterator it = grp.begin(); it != grp.end(); ++it) {
if ( (*it)->getTypeId().isDerivedFrom(typeId))
type.push_back(*it);
for (auto it : grp) {
if (it->getTypeId().isDerivedFrom(typeId))
type.push_back(it);
}
return type;
@@ -280,8 +280,8 @@ int GroupExtension::countObjectsOfType(const Base::Type& typeId) const
{
int type=0;
const std::vector<DocumentObject*>& grp = Group.getValues();
for (std::vector<DocumentObject*>::const_iterator it = grp.begin(); it != grp.end(); ++it) {
if ( (*it)->getTypeId().isDerivedFrom(typeId))
for (auto it : grp) {
if ( it->getTypeId().isDerivedFrom(typeId))
type++;
}