From 69a2ce0d432f45f24186ce7ef1683ab9af5329df Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 10 Nov 2023 10:46:48 -0800 Subject: [PATCH] Use datumIsEqual to compare --- src/hnswutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index 1e41372..08d867b 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -4,6 +4,7 @@ #include "hnsw.h" #include "storage/bufmgr.h" +#include "utils/datum.h" #include "vector.h" /* @@ -880,7 +881,7 @@ HnswFindDuplicate(HnswElement e) HnswCandidate *neighbor = &neighbors->items[i]; /* Exit early since ordered by distance */ - if (vector_cmp_internal(DatumGetVector(e->value), DatumGetVector(neighbor->element->value)) != 0) + if (!datumIsEqual(e->value, neighbor->element->value, false, -1)) break; /* Check for space */