mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 14:01:31 +08:00
Simplified CountElement [skip ci]
This commit is contained in:
@@ -725,7 +725,7 @@ AddToVisited(char *base, visited_hash * v, HnswElementPtr elementPtr, Relation i
|
||||
* Count element towards ef
|
||||
*/
|
||||
static inline bool
|
||||
CountElement(char *base, HnswElement skipElement, HnswElement e)
|
||||
CountElement(HnswElement skipElement, HnswElement e)
|
||||
{
|
||||
if (skipElement == NULL)
|
||||
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
|
||||
* affect insert performance.
|
||||
*/
|
||||
if (CountElement(base, skipElement, HnswPtrAccess(base, hc->element)))
|
||||
if (CountElement(skipElement, HnswPtrAccess(base, hc->element)))
|
||||
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
|
||||
* could affect insert performance.
|
||||
*/
|
||||
if (CountElement(base, skipElement, eElement))
|
||||
if (CountElement(skipElement, eElement))
|
||||
{
|
||||
wlen++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user