Simplified CountElement [skip ci]

This commit is contained in:
Andrew Kane
2024-09-19 04:32:38 -07:00
parent a15806196e
commit 4f8ab574c9

View File

@@ -725,7 +725,7 @@ AddToVisited(char *base, visited_hash * v, HnswElementPtr elementPtr, Relation i
* Count element towards ef * Count element towards ef
*/ */
static inline bool static inline bool
CountElement(char *base, HnswElement skipElement, HnswElement e) CountElement(HnswElement skipElement, HnswElement e)
{ {
if (skipElement == NULL) if (skipElement == NULL)
return true; return true;
@@ -851,7 +851,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
* would be ideal to do this for inserts as well, but this could * would be ideal to do this for inserts as well, but this could
* affect insert performance. * affect insert performance.
*/ */
if (CountElement(base, skipElement, HnswPtrAccess(base, hc->element))) if (CountElement(skipElement, HnswPtrAccess(base, hc->element)))
wlen++; wlen++;
} }
@@ -923,7 +923,7 @@ HnswSearchLayer(char *base, Datum q, List *ep, int ef, int lc, Relation index, F
* It would be ideal to do this for inserts as well, but this * It would be ideal to do this for inserts as well, but this
* could affect insert performance. * could affect insert performance.
*/ */
if (CountElement(base, skipElement, eElement)) if (CountElement(skipElement, eElement))
{ {
wlen++; wlen++;