diff options
author | Thomas Haller <thaller@redhat.com> | 2018-07-26 17:44:36 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-08-10 10:38:19 +0200 |
commit | 332592ef4f6315b955d5c1c0d520b2aafe939787 (patch) | |
tree | 7ccd44504eed1e730791654787a1506b8d679862 /libnm-core/nm-setting-user.c | |
parent | a587d32467e8666b41299a283c24201cf24b95d1 (diff) | |
download | NetworkManager-332592ef4f6315b955d5c1c0d520b2aafe939787.tar.gz |
libnm: use nm_utils_hash_table_equal() in nm-setting-user
Diffstat (limited to 'libnm-core/nm-setting-user.c')
-rw-r--r-- | libnm-core/nm-setting-user.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/libnm-core/nm-setting-user.c b/libnm-core/nm-setting-user.c index 56dd71e93f..db28c554c1 100644 --- a/libnm-core/nm-setting-user.c +++ b/libnm-core/nm-setting-user.c @@ -397,29 +397,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) } static gboolean -hash_table_equal (GHashTable *a, GHashTable *b) -{ - guint n; - GHashTableIter iter; - const char *key, *value, *valu2; - - n = a ? g_hash_table_size (a) : 0; - if (n != (b ? g_hash_table_size (b) : 0)) - return FALSE; - if (n > 0) { - g_hash_table_iter_init (&iter, a); - while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)) { - if (!g_hash_table_lookup_extended (b, key, NULL, (gpointer *) &valu2)) - return FALSE; - if (!nm_streq (value, valu2)) - return FALSE; - } - } - return TRUE; - -} - -static gboolean compare_property (NMSetting *setting, NMSetting *other, const GParamSpec *prop_spec, @@ -436,10 +413,10 @@ compare_property (NMSetting *setting, priv = NM_SETTING_USER_GET_PRIVATE (NM_SETTING_USER (setting)); pri2 = NM_SETTING_USER_GET_PRIVATE (NM_SETTING_USER (other)); - if (!hash_table_equal (priv->data, pri2->data)) + if (!nm_utils_hash_table_equal (priv->data, pri2->data, TRUE, g_str_equal)) return FALSE; - if (!hash_table_equal (priv->data_invalid, pri2->data_invalid)) + if (!nm_utils_hash_table_equal (priv->data_invalid, pri2->data_invalid, TRUE, g_str_equal)) return FALSE; return TRUE; |