mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 07:06:57 +08:00
Reduced calls to AddToVisited [skip ci]
This commit is contained in:
@@ -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,7 +844,8 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
|
|||||||
bool found;
|
bool found;
|
||||||
HnswPairingHeapNode *node;
|
HnswPairingHeapNode *node;
|
||||||
|
|
||||||
AddToVisited(base, v, hc->element, index, &found);
|
if (initVisited)
|
||||||
|
AddToVisited(base, v, hc->element, index, &found);
|
||||||
|
|
||||||
node = CreatePairingHeapNode(hc);
|
node = CreatePairingHeapNode(hc);
|
||||||
pairingheap_add(C, &node->c_node);
|
pairingheap_add(C, &node->c_node);
|
||||||
|
|||||||
Reference in New Issue
Block a user