diff options
author | Thomas Haller <thaller@redhat.com> | 2019-04-25 08:38:35 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-04-25 08:53:51 +0200 |
commit | 2f9e55ee52ee4f3faeb2e0a203095142cc0b14c9 (patch) | |
tree | 88c1f14d17ace9c39d552903d0429ba6025adde1 | |
parent | 6d472dacb432611beb825a27163fa63562511f99 (diff) | |
download | NetworkManager-2f9e55ee52ee4f3faeb2e0a203095142cc0b14c9.tar.gz |
shared,libnm-core: use nm_utils_named_value_list_sort()
-rw-r--r-- | libnm-core/nm-utils.c | 3 | ||||
-rw-r--r-- | shared/nm-glib-aux/nm-shared-utils.c | 5 | ||||
-rw-r--r-- | shared/nm-glib-aux/nm-shared-utils.h | 3 |
3 files changed, 2 insertions, 9 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 04d5b1b558..9a1430f6c7 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -851,8 +851,7 @@ _nm_utils_strdict_to_dbus (const GValue *prop_value) } while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)); nm_assert (i == len); - g_qsort_with_data (idx, len, sizeof (idx[0]), - nm_utils_named_entry_cmp_with_data, NULL); + nm_utils_named_value_list_sort (idx, len, NULL, NULL); for (i = 0; i < len; i++) g_variant_builder_add (&builder, "{ss}", idx[i].name, idx[i].value_str); diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index 07441323ce..94650705be 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -2156,10 +2156,7 @@ nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len) values[i].name = NULL; values[i].value_ptr = NULL; - if (len > 1) { - g_qsort_with_data (values, len, sizeof (values[0]), - nm_utils_named_entry_cmp_with_data, NULL); - } + nm_utils_named_value_list_sort (values, len, NULL, NULL); NM_SET_OUT (out_len, len); return values; diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h index aec61fe073..eea54e7143 100644 --- a/shared/nm-glib-aux/nm-shared-utils.h +++ b/shared/nm-glib-aux/nm-shared-utils.h @@ -906,9 +906,6 @@ typedef struct { }; } NMUtilsNamedValue; -#define nm_utils_named_entry_cmp nm_strcmp_p -#define nm_utils_named_entry_cmp_with_data nm_strcmp_p_with_data - NMUtilsNamedValue *nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len); gssize nm_utils_named_value_list_find (const NMUtilsNamedValue *arr, |