mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 05:51:21 +08:00
Improved compare method [skip ci]
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user