Skip to content

Commit

Permalink
adress review: const and qgis::ListToSet()
Browse files Browse the repository at this point in the history
  • Loading branch information
root676 authored and nyalldawson committed Oct 24, 2021
1 parent af7d8ce commit 57e2248
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/analysis/processing/qgsalgorithmshortestline.cpp
Expand Up @@ -129,8 +129,8 @@ QVariantMap QgsShortestLineAlgorithm::processAlgorithm( const QVariantMap &param
break;


QgsGeometry sourceGeom = sourceFeature.geometry();
QgsFeatureIds nearestIds = idx.nearestNeighbor( sourceGeom, mKNeighbors, mMaxDistance ).toSet();
const QgsGeometry sourceGeom = sourceFeature.geometry();
QgsFeatureIds nearestIds = qgis::listToSet( idx.nearestNeighbor( sourceGeom, mKNeighbors, mMaxDistance ) );

QgsFeatureRequest targetRequest = QgsFeatureRequest();
targetRequest.setFilterFids( nearestIds );
Expand All @@ -139,9 +139,9 @@ QVariantMap QgsShortestLineAlgorithm::processAlgorithm( const QVariantMap &param
QgsFeature destinationFeature;
while ( destinationIterator.nextFeature( destinationFeature ) )
{
QgsGeometry destinationGeom = destinationFeature.geometry();
const QgsGeometry destinationGeom = destinationFeature.geometry();

QgsGeometry shortestLine = sourceGeom.shortestLine( destinationGeom );
const QgsGeometry shortestLine = sourceGeom.shortestLine( destinationGeom );
double dist = da.measureLength( shortestLine );

QgsFeature f;
Expand Down

0 comments on commit 57e2248

Please sign in to comment.