[libdazzle] fuzzy: stash key_id for later



commit 10749b95ff7c85594b9bcd46266ad34aaeae0f39
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jun 4 16:18:37 2017 -0700

    fuzzy: stash key_id for later
    
    This should save us some storage costs going forward too. Not much, but
    some when we have duplicate keys (such as for desktop indexes).

 src/fuzzy/dzl-fuzzy-index-builder.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/fuzzy/dzl-fuzzy-index-builder.c b/src/fuzzy/dzl-fuzzy-index-builder.c
index 81e3dc8..e020cd3 100644
--- a/src/fuzzy/dzl-fuzzy-index-builder.c
+++ b/src/fuzzy/dzl-fuzzy-index-builder.c
@@ -276,6 +276,7 @@ dzl_fuzzy_index_builder_insert (DzlFuzzyIndexBuilder *self,
     {
       key_id = GUINT_TO_POINTER (self->keys->len | ((priority & 0xFF) << 24));
       g_ptr_array_add (self->keys, (gchar *)key);
+      g_hash_table_insert (self->key_ids, (gpointer)key, key_id);
     }
 
   pair.key_id = GPOINTER_TO_UINT (key_id);


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