diff options
author | Thomas Haller <thaller@redhat.com> | 2017-11-15 16:06:43 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-11-15 16:52:32 +0100 |
commit | db3240b97147068bff52f2ff140e3f0bb7f60767 (patch) | |
tree | d12849cb6147a3841d53648bd98252719f495324 /libnm-core/nm-utils.c | |
parent | 8e37d536bd01081487cbb61114f6fb4bd61c7baa (diff) | |
download | NetworkManager-th/nm-hash-all.tar.gz |
all: use nm_str_hash() instead of g_str_hash()th/nm-hash-all
We also do this for libnm and libnm-core, where it causes visible changes
in behavior. But if somebody would rely on the hashing implementation
for hash tables, it would be seriously flawed.
Diffstat (limited to 'libnm-core/nm-utils.c')
-rw-r--r-- | libnm-core/nm-utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 52e320421e..c3001ab5d1 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -144,7 +144,7 @@ init_lang_to_encodings_hash (void) if (G_UNLIKELY (langToEncodings5 == NULL)) { /* Five-letter codes */ enc = (struct IsoLangToEncodings *) &isoLangEntries5[0]; - langToEncodings5 = g_hash_table_new (g_str_hash, g_str_equal); + langToEncodings5 = g_hash_table_new (nm_str_hash, g_str_equal); while (enc->lang) { g_hash_table_insert (langToEncodings5, (gpointer) enc->lang, (gpointer) enc->encodings); @@ -155,7 +155,7 @@ init_lang_to_encodings_hash (void) if (G_UNLIKELY (langToEncodings2 == NULL)) { /* Two-letter codes */ enc = (struct IsoLangToEncodings *) &isoLangEntries2[0]; - langToEncodings2 = g_hash_table_new (g_str_hash, g_str_equal); + langToEncodings2 = g_hash_table_new (nm_str_hash, g_str_equal); while (enc->lang) { g_hash_table_insert (langToEncodings2, (gpointer) enc->lang, (gpointer) enc->encodings); @@ -512,7 +512,7 @@ _nm_utils_strdict_from_dbus (GVariant *dbus_value, const char *key, *value; GHashTable *hash; - hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + hash = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free); g_variant_iter_init (&iter, dbus_value); while (g_variant_iter_next (&iter, "{&s&s}", &key, &value)) g_hash_table_insert (hash, g_strdup (key), g_strdup (value)); @@ -527,7 +527,7 @@ _nm_utils_copy_strdict (GHashTable *strdict) GHashTableIter iter; gpointer key, value; - copy = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + copy = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free); if (strdict) { g_hash_table_iter_init (&iter, strdict); while (g_hash_table_iter_next (&iter, &key, &value)) @@ -4861,7 +4861,7 @@ nm_utils_parse_variant_attributes (const char *string, g_return_val_if_fail (key_value_separator, NULL); g_return_val_if_fail (!error || !*error, NULL); - ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); + ht = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); while (TRUE) { gs_free char *name = NULL, *value = NULL; |