shared,libnm-core: use nm_utils_named_value_list_sort()

This commit is contained in:
Thomas Haller 2019-04-25 08:38:35 +02:00
parent 6d472dacb4
commit 2f9e55ee52
3 changed files with 2 additions and 9 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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,