diff options
author | Richard Hughes <richard@hughsie.com> | 2015-06-29 15:29:54 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-06-29 15:47:11 +0100 |
commit | 8073a2a5ce77915842522542c7eda97a9fdf620e (patch) | |
tree | e7f180a987f86990bd1f1bd69ecd1f81ba619157 | |
parent | 915f1323121a5827c16ab76d471adfc82411584f (diff) | |
download | appstream-glib-8073a2a5ce77915842522542c7eda97a9fdf620e.tar.gz |
trivial: Do not check the localstate dirs multiple times
-rw-r--r-- | libappstream-glib/as-store.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index db7d9c0..13dbb99 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -1781,10 +1781,6 @@ as_store_load (AsStore *store, if ((flags & AS_STORE_LOAD_FLAG_APP_INFO_SYSTEM) > 0) { path = g_build_filename (data_dirs[i], "app-info", NULL); g_ptr_array_add (app_info, path); - path = g_build_filename (LOCALSTATEDIR, "lib", "app-info", NULL); - g_ptr_array_add (app_info, path); - path = g_build_filename (LOCALSTATEDIR, "cache", "app-info", NULL); - g_ptr_array_add (app_info, path); } if ((flags & AS_STORE_LOAD_FLAG_APPDATA) > 0) { path = g_build_filename (data_dirs[i], "appdata", NULL); @@ -1795,6 +1791,12 @@ as_store_load (AsStore *store, g_ptr_array_add (installed, path); } } + if ((flags & AS_STORE_LOAD_FLAG_APP_INFO_SYSTEM) > 0) { + path = g_build_filename (LOCALSTATEDIR, "lib", "app-info", NULL); + g_ptr_array_add (app_info, path); + path = g_build_filename (LOCALSTATEDIR, "cache", "app-info", NULL); + g_ptr_array_add (app_info, path); + } /* per-user locations */ if ((flags & AS_STORE_LOAD_FLAG_APP_INFO_USER) > 0) { |