[libdazzle] fuzzy: fix score comparison



commit c8df9e6333fe196c23c3e5b7ea29b051f9d5fdaf
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jun 5 00:32:11 2017 -0700

    fuzzy: fix score comparison
    
    We don't want &other_score, but other_score pointer directly. Also, we
    had the comparison inverted, we want higher values to be the winner once
    we've converted to floats.

 src/fuzzy/dzl-fuzzy-index-cursor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/fuzzy/dzl-fuzzy-index-cursor.c b/src/fuzzy/dzl-fuzzy-index-cursor.c
index a8f926e..4154ca5 100644
--- a/src/fuzzy/dzl-fuzzy-index-cursor.c
+++ b/src/fuzzy/dzl-fuzzy-index-cursor.c
@@ -469,7 +469,7 @@ dzl_fuzzy_index_cursor_worker (GTask        *task,
                                         GUINT_TO_POINTER (match.document_id),
                                         NULL,
                                         &other_score) &&
-          pointer_to_float (&other_score) <= match.score)
+          match.score <= pointer_to_float (other_score))
         continue;
 
       g_hash_table_insert (by_document,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]