Skip to content

Commit

Permalink
Micro optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 12, 2019
1 parent 0224b8e commit 3113a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/qgsvectorlayereditutils.cpp
Expand Up @@ -352,9 +352,10 @@ QgsGeometry::OperationResult QgsVectorLayerEditUtils::splitFeatures( const QVect
mLayer->changeGeometry( feat.id(), featureGeom );

//insert new features
for ( int i = 0; i < newGeometries.size(); ++i )
QgsAttributeMap attributeMap = feat.attributes().toMap();
for ( const QgsGeometry &geom : qgis::as_const( newGeometries ) )
{
QgsFeature f = QgsVectorLayerUtils::createFeature( mLayer, newGeometries.at( i ), feat.attributes().toMap() );
QgsFeature f = QgsVectorLayerUtils::createFeature( mLayer, geom, attributeMap );
mLayer->addFeature( f );
}

Expand Down

0 comments on commit 3113a96

Please sign in to comment.