mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 05:51:21 +08:00
Use NIL for empty lists (#890)
Postgres standard way to check for list emptiness is to compare a pointer to NIL rather than NULL.
This commit is contained in:
@@ -130,7 +130,7 @@ hnswcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
||||
Relation index;
|
||||
|
||||
/* Never use index without order */
|
||||
if (path->indexorderbys == NULL)
|
||||
if (path->indexorderbys == NIL)
|
||||
{
|
||||
*indexStartupCost = get_float8_infinity();
|
||||
*indexTotalCost = get_float8_infinity();
|
||||
|
||||
@@ -92,7 +92,7 @@ ivfflatcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
||||
Relation index;
|
||||
|
||||
/* Never use index without order */
|
||||
if (path->indexorderbys == NULL)
|
||||
if (path->indexorderbys == NIL)
|
||||
{
|
||||
*indexStartupCost = get_float8_infinity();
|
||||
*indexTotalCost = get_float8_infinity();
|
||||
|
||||
Reference in New Issue
Block a user