pgvector.git / summary / log / commit / refs
commit f0e8dabffe2ccd016738935243b830b5a25410fd
Author: Andrew Kane <andrew@ankane.org>
Date: Wed Jul 29 02:29:30 2026 +0000
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;
[parent: b00dec8c98af]