pgvector.git / summary / log / commit / refs

commit    cf46c3f651fdae2dcd608999c758b990940e242a
Author:   Andrew Kane <andrew@ankane.org>
Date:     Wed Apr 24 22:57:29 2024 +0000

    Improved code [skip ci]


src/ivfkmeans.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ivfkmeans.c b/src/ivfkmeans.c index 4f2865df..14e2eefc 100644 --- a/src/ivfkmeans.c +++ b/src/ivfkmeans.c @@ -287,7 +287,6 @@ BitSumCenter(const void *v, Vector * aggCenter) static void SumCenters(VectorArray samples, VectorArray aggCenters, int *closestCenters, IvfflatType type) { - int numSamples = samples->length; void (*sumCenter) (const void *v, Vector * aggCenter); if (type == IVFFLAT_TYPE_VECTOR) @@ -299,8 +298,7 @@ SumCenters(VectorArray samples, VectorArray aggCenters, int *closestCenters, Ivf else elog(ERROR, "Unsupported type"); - - for (int j = 0; j < numSamples; j++) + for (int j = 0; j < samples->length; j++) { Vector *aggCenter = (Vector *) VectorArrayGet(aggCenters, closestCenters[j]); [parent: fb6683ade7cf]