From 8801832946afa1401f6a0132f16d93dd9e45283b Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 25 Aug 2023 20:46:05 -0700 Subject: [PATCH] Fixed check in SelectNeighbors --- src/hnswutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index ccd9799..1a3e234 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -733,7 +733,7 @@ SelectNeighbors(List *c, int m, int lc, FmgrInfo *procinfo, Oid collation, HnswC List *w = list_copy(c); pairingheap *wd; - if (list_length(w) < m) + if (list_length(w) <= m) return w; wd = pairingheap_allocate(CompareNearestCandidates, NULL);