[PATCH v2 1/4] entity: use g_hash_table_replace instead of remove+insert

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

 



Signed-off-by: Giuseppe Scrivano <gscrivan@xxxxxxxxxx>
---
 osinfo/osinfo_entity.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/osinfo/osinfo_entity.c b/osinfo/osinfo_entity.c
index 5c062bc..1212f13 100644
--- a/osinfo/osinfo_entity.c
+++ b/osinfo/osinfo_entity.c
@@ -1,7 +1,7 @@
 /*
  * libosinfo:
  *
- * Copyright (C) 2009-2012 Red Hat, Inc.
+ * Copyright (C) 2009-2012, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -187,9 +187,8 @@ void osinfo_entity_set_param(OsinfoEntity *entity, const gchar *key, const gchar
 
     GList *values = NULL;
 
-    g_hash_table_remove(entity->priv->params, key);
     values = g_list_append(values, g_strdup(value));
-    g_hash_table_insert(entity->priv->params, g_strdup(key), values);
+    g_hash_table_replace(entity->priv->params, g_strdup(key), values);
 }
 
 
-- 
1.9.3

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux