diff options
author | Richard Hughes <richard@hughsie.com> | 2016-11-01 20:06:15 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-01-17 10:36:20 +0000 |
commit | b01dd3fdb5329f59ea5ef5ff61ec178daf1ef654 (patch) | |
tree | 4bcc8be4957fa650d6c0b2e83a2cd9acf43ddfc9 | |
parent | 930e75be429db8412f88ac0d504f5cfc668c9fea (diff) | |
download | appstream-glib-b01dd3fdb5329f59ea5ef5ff61ec178daf1ef654.tar.gz |
trivial: Allow priming the search cache using a NULL search value
-rw-r--r-- | libappstream-glib/as-app.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 40b6bb4..f88052e 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -4553,16 +4553,16 @@ as_app_search_matches (AsApp *app, const gchar *search) g_autoptr(GList) keys = NULL; g_autofree gchar *search_stem = NULL; - /* nothing to do */ - if (search == NULL) - return 0; - /* ensure the token cache is created */ if (g_once_init_enter (&priv->token_cache_valid)) { as_app_create_token_cache (app); g_once_init_leave (&priv->token_cache_valid, TRUE); } + /* nothing to do */ + if (search == NULL) + return 0; + /* find the exact match (which is more awesome than a partial match) */ search_stem = as_stemmer_process (priv->stemmer, search); match_pval = g_hash_table_lookup (priv->token_cache, search_stem); |