Skip to content

Commit

Permalink
Minor optimisation to QgsFields::allAttributesList()
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and nirvn committed Nov 15, 2019
1 parent 2e01041 commit 380ebe2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/qgsfields.cpp
Expand Up @@ -350,8 +350,10 @@ int QgsFields::lookupField( const QString &fieldName ) const

QgsAttributeList QgsFields::allAttributesList() const
{
const int count = d->fields.count();
QgsAttributeList lst;
for ( int i = 0; i < d->fields.count(); ++i )
lst.reserve( count );
for ( int i = 0; i < count; ++i )
lst.append( i );
return lst;
}
Expand Down

0 comments on commit 380ebe2

Please sign in to comment.