diff options
author | Richard Hughes <richard@hughsie.com> | 2016-11-01 20:06:15 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-11-01 20:06:15 +0000 |
commit | 92fcfbd4582bad657372edca6acaa48140df600a (patch) | |
tree | 81e1094d01fade5493327eec16e1fdda598bcab3 | |
parent | b365cf553041c34cebb60c655a71fde8c338c3b5 (diff) | |
download | appstream-glib-92fcfbd4582bad657372edca6acaa48140df600a.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 1bb6aff..128a9ef 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -5259,16 +5259,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); |