summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-app.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2018-05-21 17:09:42 +0100
committerRichard Hughes <richard@hughsie.com>2018-05-21 17:15:10 +0100
commitf63810c8d1a1e397e1f44fbeb10528f1e875ce3a (patch)
tree8b49dc42f655d18a5621a705e62f9d09841d98ce /libappstream-glib/as-app.c
parentf498bb9ca87eb6f30484dcbf57972c3673c07f59 (diff)
downloadappstream-glib-f63810c8d1a1e397e1f44fbeb10528f1e875ce3a.tar.gz
trivial: Assume that all strings are AsRefString objects when using subsume
Diffstat (limited to 'libappstream-glib/as-app.c')
-rw-r--r--libappstream-glib/as-app.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index 7a8ee26..4d16739 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -3920,28 +3920,22 @@ as_app_add_addon (AsApp *app, AsApp *addon)
/******************************************************************************/
-
static void
as_app_subsume_dict (GHashTable *dest, GHashTable *src, guint64 flags)
{
- GList *l;
- const gchar *tmp;
- const gchar *key;
- const gchar *value;
- g_autoptr(GList) keys = NULL;
-
- keys = g_hash_table_get_keys (src);
+ g_autoptr(GList) keys = g_hash_table_get_keys (src);
if ((flags & AS_APP_SUBSUME_FLAG_REPLACE) > 0 && keys != NULL)
g_hash_table_remove_all (dest);
- for (l = keys; l != NULL; l = l->next) {
- key = l->data;
+ for (GList *l = keys; l != NULL; l = l->next) {
+ AsRefString *key = l->data;
+ AsRefString *value;
if (flags & AS_APP_SUBSUME_FLAG_NO_OVERWRITE) {
- tmp = g_hash_table_lookup (dest, key);
+ const gchar *tmp = g_hash_table_lookup (dest, key);
if (tmp != NULL)
continue;
}
value = g_hash_table_lookup (src, key);
- g_hash_table_insert (dest, as_ref_string_new (key), as_ref_string_new (value));
+ g_hash_table_insert (dest, as_ref_string_ref (key), as_ref_string_ref (value));
}
}