From 2fb4178f7c145d33a8caa986e6a957c0d4fa9f3d Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 6 Mar 2015 10:17:37 +0300 Subject: [PATCH] Reduce variable scope --- modules/core/src/kmeans.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/core/src/kmeans.cpp b/modules/core/src/kmeans.cpp index efc22dc0e..cc86d2972 100644 --- a/modules/core/src/kmeans.cpp +++ b/modules/core/src/kmeans.cpp @@ -180,10 +180,9 @@ public: const int K = centers.rows; const int dims = centers.cols; - const float *sample; for( int i = begin; i(i); + const float *sample = data.ptr(i); int k_best = 0; double min_dist = DBL_MAX;