Keep scan-build happy

This commit is contained in:
Andrew Kane
2024-09-19 04:02:09 -07:00
parent 5c9429a0f8
commit a15806196e

View File

@@ -874,6 +874,8 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
for (int i = 0; i < unvisitedLength; i++)
{
HnswElement eElement;
HnswCandidate *e;
HnswPairingHeapNode *node;
float eDistance;
bool alwaysAdd = wlen < ef;
@@ -883,6 +885,9 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
{
eElement = unvisited[i].element;
eDistance = GetElementDistance(base, eElement, q, procinfo, collation);
if (!(eDistance < f->distance || alwaysAdd))
continue;
}
else
{
@@ -893,12 +898,10 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
/* Avoid any allocations if not adding */
eElement = NULL;
HnswLoadElementImpl(blkno, offno, &eDistance, &q, index, procinfo, collation, inserting, alwaysAdd ? NULL : &f->distance, &eElement);
}
if (eDistance < f->distance || alwaysAdd)
{
HnswCandidate *e;
HnswPairingHeapNode *node;
if (eElement == NULL)
continue;
}
Assert(!eElement->deleted);
@@ -916,9 +919,9 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
pairingheap_add(W, &node->w_node);
/*
* Do not count elements being deleted towards ef when
* vacuuming. It would be ideal to do this for inserts as
* well, but this could affect insert performance.
* Do not count elements being deleted towards ef when vacuuming.
* It would be ideal to do this for inserts as well, but this
* could affect insert performance.
*/
if (CountElement(base, skipElement, eElement))
{
@@ -930,7 +933,6 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
}
}
}
}
/* Add each element of W to w */
while (!pairingheap_is_empty(W))