From e4bb317a1b8a954d43f1cff7885f5fac5312da7d 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 --- src/core/pointcloud/qgseptpointcloudindex.cpp | 2 +- src/core/pointcloud/qgspointcloudstatscalculator.cpp | 2 +- src/core/raster/qgsrasterlayer.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/pointcloud/qgseptpointcloudindex.cpp b/src/core/pointcloud/qgseptpointcloudindex.cpp index 027da9662a7b..4b7d8f68eedf 100644 --- a/src/core/pointcloud/qgseptpointcloudindex.cpp +++ b/src/core/pointcloud/qgseptpointcloudindex.cpp @@ -522,7 +522,7 @@ QgsPointCloudStatistics QgsEptPointCloudIndex::metadataStatistics() const s.classCount = mAttributeClasses[ name ]; - statsMap[ name ] = s; + statsMap[ name ] = std::move( s ); } return QgsPointCloudStatistics( pointCount(), statsMap ); } diff --git a/src/core/pointcloud/qgspointcloudstatscalculator.cpp b/src/core/pointcloud/qgspointcloudstatscalculator.cpp index 5748dd2412a5..61bb760edcbb 100644 --- a/src/core/pointcloud/qgspointcloudstatscalculator.cpp +++ b/src/core/pointcloud/qgspointcloudstatscalculator.cpp @@ -112,7 +112,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 adecf663332f..cfbbb1d12187 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 ) {