mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 07:06:57 +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
|
* 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++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user