From 5c005cf57c49d802a3f881265fbf86498280e3c1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 2 Sep 2023 17:41:31 -0700 Subject: [PATCH] Revert "No need to increment wlen when removing" This reverts commit 6b2e215447e86c40267f17b271a26bba897f7172. --- src/hnswutils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index 76051b2..8e6f2a9 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -645,10 +645,11 @@ HnswSearchLayer(Datum q, List *ep, int ef, int lc, Relation index, FmgrInfo *pro */ if (skipElement == NULL || list_length(e->element->heaptids) != 0) { - if (wlen >= ef) + wlen++; + + /* No need to decrement wlen */ + if (wlen > ef) pairingheap_remove_first(W); - else - wlen++; } } }