Skip to content
Permalink
Browse files
adress review: const and qgis::ListToSet()
  • Loading branch information
root676 authored and nyalldawson committed Oct 24, 2021
1 parent af7d8ce commit 57e2248e33031f45310e3e129794f203d2dd63d9
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/analysis/processing/qgsalgorithmshortestline.cpp
@@ -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 );
@@ -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;

0 comments on commit 57e2248

Please sign in to comment.