From f0e8dabffe2ccd016738935243b830b5a25410fd Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 28 Jul 2026 19:29:30 -0700 Subject: [PATCH] Improved scoping [skip ci] --- src/ivfkmeans.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ivfkmeans.c b/src/ivfkmeans.c index 1dec6a5f..9ebaeffc 100644 --- a/src/ivfkmeans.c +++ b/src/ivfkmeans.c @@ -25,7 +25,6 @@ InitCenters(Relation index, VectorArray samples, VectorArray centers, float *low { FmgrInfo *procinfo; Oid collation; - int64 j; float *weight = palloc_array_checked(float, samples->length); int numCenters = centers->maxlen; int numSamples = samples->length; @@ -37,11 +36,12 @@ InitCenters(Relation index, VectorArray samples, VectorArray centers, float *low VectorArraySet(centers, 0, VectorArrayGet(samples, RandomInt() % samples->length)); centers->length++; - for (j = 0; j < numSamples; j++) - weight[j] = FLT_MAX; + for (int i = 0; i < numSamples; i++) + weight[i] = FLT_MAX; for (int i = 0; i < numCenters; i++) { + int64 j; double sum; double choice;