mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-23 03:04:18 +00:00
all: use nm_strcmp_p() for sorting strings
This commit is contained in:
parent
c629378d2e
commit
d37945b064
|
@ -233,12 +233,6 @@ route_writer (KeyfileWriterInfo *info,
|
|||
write_ip_values (info->keyfile, setting_name, array, NULL, TRUE);
|
||||
}
|
||||
|
||||
static int
|
||||
sort_hash_keys (gconstpointer a, gconstpointer b, gpointer user_data)
|
||||
{
|
||||
return g_strcmp0 (*((const char **) a), *((const char **) b));
|
||||
}
|
||||
|
||||
static void
|
||||
write_hash_of_string (GKeyFile *file,
|
||||
NMSetting *setting,
|
||||
|
@ -262,7 +256,7 @@ write_hash_of_string (GKeyFile *file,
|
|||
if (!keys)
|
||||
return;
|
||||
|
||||
g_qsort_with_data (keys, l, sizeof (const char *), sort_hash_keys, NULL);
|
||||
g_qsort_with_data (keys, l, sizeof (const char *), nm_strcmp_p_with_data, NULL);
|
||||
|
||||
for (i = 0; keys[i]; i++) {
|
||||
const char *property, *data;
|
||||
|
|
|
@ -880,15 +880,6 @@ read_base_config (GKeyFile *keyfile,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
sort_asciibetically (gconstpointer a, gconstpointer b)
|
||||
{
|
||||
const char *s1 = *(const char **)a;
|
||||
const char *s2 = *(const char **)b;
|
||||
|
||||
return strcmp (s1, s2);
|
||||
}
|
||||
|
||||
static GPtrArray *
|
||||
_get_config_dir_files (const char *config_dir)
|
||||
{
|
||||
|
@ -917,7 +908,7 @@ _get_config_dir_files (const char *config_dir)
|
|||
}
|
||||
g_object_unref (dir);
|
||||
|
||||
g_ptr_array_sort (confs, sort_asciibetically);
|
||||
g_ptr_array_sort (confs, nm_strcmp_p);
|
||||
return confs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue