Skip to content
Permalink
Browse files
QgsRasterAnalysisUtils: fix range loop constructs warning
Loops create a copy from map. Use reference type to prevent copying.
  • Loading branch information
lbartoletti authored and nyalldawson committed Aug 16, 2021
1 parent e81415c commit 0dbf1631cfaee90259262913cd33c0813e6f69e2
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/analysis/processing/qgsrasteranalysisutils.cpp
@@ -401,7 +401,7 @@ double QgsRasterAnalysisUtils::majorityFromCellValues( std::vector<double> &cell
int maxCount = 0;
bool multipleMajorities = false;
double result = noDataValue;
for ( const auto pair : map )
for ( const auto &pair : map )
{
if ( maxCount < pair.second )
{
@@ -449,7 +449,7 @@ double QgsRasterAnalysisUtils::minorityFromCellValues( std::vector<double> &cell
int minCount = stackSize;
bool multipleMinorities = false;
double result = noDataValue; //result will stay NoData if no minority value exists
for ( const auto pair : map )
for ( const auto &pair : map )
{
if ( minCount > pair.second )
{

0 comments on commit 0dbf163

Please sign in to comment.