pgvector.git / summary / log / commit / refs
commit a37f5eea4a72d04733ad73b88b382dd4a734fb51
Author: Andrew Kane <andrew@ankane.org>
Date: Tue Feb 15 19:50:35 2022 +0000
Improved compare method [skip ci]
src/ivfscan.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/ivfscan.c b/src/ivfscan.c
index aa41275b..e2171b0e 100644
--- a/src/ivfscan.c
+++ b/src/ivfscan.c
@@ -21,12 +21,10 @@
static int
CompareLists(const pairingheap_node *a, const pairingheap_node *b, void *arg)
{
- double diff = ((const IvfflatScanList *) a)->distance - ((const IvfflatScanList *) b)->distance;
-
- if (diff > 0)
+ if (((const IvfflatScanList *) a)->distance > ((const IvfflatScanList *) b)->distance)
return 1;
- if (diff < 0)
+ if (((const IvfflatScanList *) a)->distance < ((const IvfflatScanList *) b)->distance)
return -1;
return 0;
[parent: 4bdb27e85a39]