Skip to content

Commit

Permalink
Use iterator for parts
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 19, 2019
1 parent 4c8af20 commit 0b248dc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/analysis/processing/qgsalgorithmpolygonstolines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ QList<int> QgsPolygonsToLinesAlgorithm::inputLayerTypes() const

QgsFeatureList QgsPolygonsToLinesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback * )
{
Q_UNUSED( context )

QgsFeatureList result;
QgsFeature feat = feature;
if ( feat.hasGeometry() )
Expand Down Expand Up @@ -126,10 +128,9 @@ QList<QgsCurve *> QgsPolygonsToLinesAlgorithm::extractRings( const QgsAbstractGe

if ( QgsGeometryCollection *collection = qgsgeometry_cast<QgsGeometryCollection *>( geom ) )
{
for ( int i = 0; i < collection->numGeometries(); ++i )
{
rings.append( extractRings( collection->geometryN( i ) ) );
}
QgsGeometryPartIterator parts = collection->parts();
while ( parts.hasNext() )
rings.append( extractRings( parts.next() ) );
}
else if ( QgsCurvePolygon *polygon = qgsgeometry_cast<QgsCurvePolygon *>( geom ) )
{
Expand Down

0 comments on commit 0b248dc

Please sign in to comment.