Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use cheap request
  • Loading branch information
m-kuhn committed Jun 4, 2018
1 parent cb4de25 commit 3b35948
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgsvectordataprovider.cpp
Expand Up @@ -49,7 +49,11 @@ QString QgsVectorDataProvider::storageType() const
bool QgsVectorDataProvider::empty() const
{
QgsFeature f;
if ( getFeatures().nextFeature( f ) )
QgsFeatureRequest request;
request.setSubsetOfAttributes( QgsAttributeList() );
request.setFlags( QgsFeatureRequest::NoGeometry );
request.setLimit( 1 );
if ( getFeatures( request ).nextFeature( f ) )
return true;
else
return false;
Expand Down

0 comments on commit 3b35948

Please sign in to comment.