From dd3a1e9137d8cd2877c9d5891e6d9928e3f59077 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Sat, 23 Aug 2025 18:31:22 +0800 Subject: [PATCH] Use NIL for empty lists (#890) Postgres standard way to check for list emptiness is to compare a pointer to NIL rather than NULL. --- src/hnsw.c | 2 +- src/ivfflat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hnsw.c b/src/hnsw.c index ec7c988..6a6db50 100644 --- a/src/hnsw.c +++ b/src/hnsw.c @@ -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(); diff --git a/src/ivfflat.c b/src/ivfflat.c index 736d537..31c2f7d 100644 --- a/src/ivfflat.c +++ b/src/ivfflat.c @@ -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();