App: modernize C++: use range-based for loop
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user