From cbaee2938faa7119772eaae2d90e2098b8abdfa1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 17 Nov 2026 22:59:05 -0800 Subject: [PATCH] Updated CompareLists to use CompareListsSort [skip ci] --- src/ivfscan.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/ivfscan.c b/src/ivfscan.c index 40c70b49..2d7e1541 100644 --- a/src/ivfscan.c +++ b/src/ivfscan.c @@ -36,21 +36,6 @@ #define GetScanList(ptr) pairingheap_container(IvfflatScanList, ph_node, ptr) #define GetScanListConst(ptr) pairingheap_const_container(IvfflatScanList, ph_node, ptr) -/* - * Compare list distances - */ -static int -CompareLists(const pairingheap_node *a, const pairingheap_node *b, void *arg) -{ - if (GetScanListConst(a)->distance > GetScanListConst(b)->distance) - return 1; - - if (GetScanListConst(a)->distance < GetScanListConst(b)->distance) - return -1; - - return 0; -} - /* * Compare list distances for sort */ @@ -66,6 +51,15 @@ CompareListsSort(const void *a, const void *b) return 0; } +/* + * Compare list distances + */ +static int +CompareLists(const pairingheap_node *a, const pairingheap_node *b, void *arg) +{ + return CompareListsSort(GetScanListConst(a), GetScanListConst(b)); +} + /* * Initialize binary heap */