Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[geometry snapper] Use std::as_const when appropriate
  • Loading branch information
nirvn authored and nyalldawson committed Sep 1, 2021
1 parent e7ff071 commit 553bb27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsalgorithmsnapgeometries.cpp
Expand Up @@ -191,7 +191,7 @@ QVariantMap QgsSnapGeometriesAlgorithm::processAlgorithm( const QVariantMap &par
// reversed order snapping round is required to insure geometries are snapped against all features
snapper = QgsInternalGeometrySnapper( tolerance, mode );
std::reverse( editedFeatureIds.begin(), editedFeatureIds.end() );
for ( const QgsFeatureId &fid : editedFeatureIds )
for ( const QgsFeatureId &fid : std::as_const( editedFeatureIds ) )
{
if ( feedback->isCanceled() )
break;
Expand All @@ -208,7 +208,7 @@ QVariantMap QgsSnapGeometriesAlgorithm::processAlgorithm( const QVariantMap &par

if ( !feedback->isCanceled() )
{
for ( const QgsFeatureId &fid : editedFeatureIds )
for ( const QgsFeatureId &fid : std::as_const( editedFeatureIds ) )
{
QgsFeature outFeature( editedFeatures.value( fid ) );
if ( !sink->addFeature( outFeature ) )
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/vector/qgsgeometrysnapper.cpp
Expand Up @@ -239,7 +239,7 @@ QgsPoint QgsSnapIndex::getClosestSnapToPoint( const QgsPoint &startPoint, const
struct _GEOSQueryCallbackData callbackData;
callbackData.list = &items;
GEOSSTRtree_query_r( geosctxt, mSTRTree, searchDiagonal.get(), _GEOSQueryCallback, &callbackData );
for ( const SnapItem *item : items )
for ( const SnapItem *item : std::as_const( items ) )
{
if ( item->type == SnapSegment )
{
Expand Down

0 comments on commit 553bb27

Please sign in to comment.