From e3ac9f6798d2857cc4dd2a2305056397aabf4073 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sun, 15 Dec 2024 07:45:18 +1000 Subject: [PATCH] Fix some copy instead of move warnings (cherry picked from commit 6bd1e2cb0d3fa47c459a331ca009174c2ee9dd6a) --- src/core/pointcloud/qgspointcloudstatscalculator.cpp | 2 +- src/core/raster/qgsrasterlayer.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/pointcloud/qgspointcloudstatscalculator.cpp b/src/core/pointcloud/qgspointcloudstatscalculator.cpp index 86f13c064f70..f3983e38106c 100644 --- a/src/core/pointcloud/qgspointcloudstatscalculator.cpp +++ b/src/core/pointcloud/qgspointcloudstatscalculator.cpp @@ -106,7 +106,7 @@ struct StatsProcessor summary.mean = 0; summary.stDev = std::numeric_limits::quiet_NaN(); summary.classCount.clear(); - statsMap[ attribute.name() ] = summary; + statsMap[ attribute.name() ] = std::move( summary ); } QVector attributeOffsetVector; diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp index d3a8ca253d87..acd80c57d199 100644 --- a/src/core/raster/qgsrasterlayer.cpp +++ b/src/core/raster/qgsrasterlayer.cpp @@ -1407,8 +1407,7 @@ void QgsRasterLayer::setContrastEnhancement( QgsContrastEnhancement::ContrastEnh return; } - const auto constMyBands = myBands; - for ( const int myBand : constMyBands ) + for ( const int myBand : std::as_const( myBands ) ) { if ( myBand != -1 ) {