From a37f5eea4a72d04733ad73b88b382dd4a734fb51 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 15 Feb 2022 11:50:35 -0800 Subject: [PATCH] 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 aa41275..e2171b0 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;