From 0e5338676d5a6d5cf86f63b464085684d9661369 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 4 Oct 2023 17:58:41 -0700 Subject: [PATCH] Added comments [skip ci] --- src/hnswutils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hnswutils.c b/src/hnswutils.c index 910ba11..9122b34 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -769,6 +769,7 @@ SelectNeighbors(List *c, int m, int lc, FmgrInfo *procinfo, Oid collation, HnswE w = list_delete_last(w); + /* r and wd will be the same as previous calls until new element */ if (mustCalculate) closer = CheckElementCloser(e, r, lc, procinfo, collation); else if (e->element == e2->neighbors[lc].firstPruned) @@ -792,6 +793,7 @@ SelectNeighbors(List *c, int m, int lc, FmgrInfo *procinfo, Oid collation, HnswE } /* Save first pruned */ + /* OK to leave previous element if empty */ if (!pairingheap_is_empty(wd)) e2->neighbors[lc].firstPruned = ((HnswPairingHeapNode *) pairingheap_first(wd))->inner->element;