Skip to content
Permalink
Browse files
[geometry snapper] Use std::as_const when appropriate
  • Loading branch information
nirvn authored and nyalldawson committed Sep 1, 2021
1 parent e7ff071 commit 553bb27bc9fe669719d5fd031fb3f5642f4f3109
@@ -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;
@@ -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 ) )
@@ -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 )
{

0 comments on commit 553bb27

Please sign in to comment.