Skip to content

Commit

Permalink
Use unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 16, 2024
1 parent 656b63d commit b5b4b07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/providers/wfs/qgswfsfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,25 +644,25 @@ void QgsWFSFeatureDownloaderImpl::run( bool serializeFeatures, long long maxFeat
}
if ( allExpectedType )
{
QgsGeometryCollection *newGC;
std::unique_ptr< QgsGeometryCollection > newGC;
if ( mShared->mWKBType == Qgis::WkbType::MultiPoint )
{
newGC = new QgsMultiPoint();
newGC = std::make_unique< QgsMultiPoint >();
}
else if ( mShared->mWKBType == Qgis::WkbType::MultiLineString )
{
newGC = new QgsMultiLineString();
newGC = std::make_unique< QgsMultiLineString >();
}
else
{
newGC = new QgsMultiPolygon();
newGC = std::make_unique< QgsMultiPolygon >();
}
newGC->reserve( gc->numGeometries() );
for ( int i = 0; i < gc->numGeometries(); ++i )
{
newGC->addGeometry( gc->geometryN( i )->clone() );
}
f.setGeometry( QgsGeometry( newGC ) );
f.setGeometry( std::move( newGC ) );
}
}
}
Expand Down

0 comments on commit b5b4b07

Please sign in to comment.