reserve space in feature list for performance (#8322)

This commit is contained in:
Denis Rouzaud 2018-10-25 05:19:13 -08:00 committed by GitHub
parent d1423decc8
commit 6a9cff3fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3024,6 +3024,7 @@ const QgsFeatureIds &QgsVectorLayer::selectedFeatureIds() const
QgsFeatureList QgsVectorLayer::selectedFeatures() const QgsFeatureList QgsVectorLayer::selectedFeatures() const
{ {
QgsFeatureList features; QgsFeatureList features;
features.reserve( mSelectedFeatureIds.count() );
QgsFeature f; QgsFeature f;
if ( mSelectedFeatureIds.count() <= 8 ) if ( mSelectedFeatureIds.count() <= 8 )