Reduced calls to AddToVisited [skip ci]

This commit is contained in:
Andrew Kane
2024-09-21 00:32:31 -07:00
parent a0fddf2d1d
commit 5266c208a6

View File

@@ -824,8 +824,6 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
if (v == NULL) if (v == NULL)
{ {
v = &v2; v = &v2;
/* Keep scan-build happy */
initVisited = true; initVisited = true;
} }
@@ -846,6 +844,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
bool found; bool found;
HnswPairingHeapNode *node; HnswPairingHeapNode *node;
if (initVisited)
AddToVisited(base, v, hc->element, index, &found); AddToVisited(base, v, hc->element, index, &found);
node = CreatePairingHeapNode(hc); node = CreatePairingHeapNode(hc);