From 5266c208a6572766ff68a41aa862ff60aed849de Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 21 Sep 2024 00:32:31 -0700 Subject: [PATCH] Reduced calls to AddToVisited [skip ci] --- src/hnswutils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index 6a06b6c..89c2eaa 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -824,8 +824,6 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F if (v == NULL) { v = &v2; - - /* Keep scan-build happy */ initVisited = true; } @@ -846,7 +844,8 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F bool found; HnswPairingHeapNode *node; - AddToVisited(base, v, hc->element, index, &found); + if (initVisited) + AddToVisited(base, v, hc->element, index, &found); node = CreatePairingHeapNode(hc); pairingheap_add(C, &node->c_node);