mirror of
https://github.com/pgvector/pgvector.git
synced 2026-12-04 00:08:30 +00:00
Updated CompareLists to use CompareListsSort [skip ci]
This commit is contained in:
1 parent
d40e365b11
commit
cbaee2938f
1 file changed
+9
-15
+9
-15
@@ -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
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user