Skip to content

Commit

Permalink
Remove const copy in favor of qgis::as_const
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Aug 19, 2019
1 parent 5549a4e commit 69b1ba5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/qgsjsonutils.cpp
Expand Up @@ -235,10 +235,9 @@ json QgsJsonExporter::exportFeaturesToJsonObject( const QgsFeatureList &features
{ "type", "FeatureCollection" },
{ "features", json::array() }
};
const auto constFeatures = features;
for ( const QgsFeature &feature : constFeatures )
for ( const QgsFeature &feature : qgis::as_const( features ) )
{
data[ "features" ].push_back( exportFeatureToJsonObject( feature ) );
data["features"].push_back( exportFeatureToJsonObject( feature ) );
}
return data;
}
Expand Down

0 comments on commit 69b1ba5

Please sign in to comment.