From b95fd4d757b510f8bd4dbe8b7de41968211e1884 Mon Sep 17 00:00:00 2001 From: viperminiq Date: Thu, 8 May 2025 11:01:14 +0200 Subject: [PATCH] fix uninitialized variable --- src/analysis/processing/qgsalgorithmkmeansclustering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis/processing/qgsalgorithmkmeansclustering.cpp b/src/analysis/processing/qgsalgorithmkmeansclustering.cpp index e1b24ece0f8..bff03cfb2cf 100644 --- a/src/analysis/processing/qgsalgorithmkmeansclustering.cpp +++ b/src/analysis/processing/qgsalgorithmkmeansclustering.cpp @@ -422,7 +422,7 @@ void QgsKMeansClusteringAlgorithm::initClustersPlusPlus( std::vector &p // store distances between previous and new candidate center, error and best candidate index double currentError = 0; double lowestError = std::numeric_limits::max(); - size_t bestCandidateIndex; + unsigned int bestCandidateIndex = 0; for ( unsigned int j = 0; j < numCandidateCenters; j++ ) { for ( size_t z = 0; z < n; z++ )