core: don't sort connection list for nm_utils_complete_generic()

We create the all_connections list in impl_manager_add_and_activate_connection().
With this list we either call nm_utils_complete_generic() directly,
or pass it to nm_device_complete_connection(). The latter also ends
up only calling nm_utils_complete_generic() with this argument.

nm_utils_complete_generic() doesn't care about the order in which
the connections are returned. Which also becomes apparent, because
we first sorted the list, and then reverted the order with
g_slist_prepend().

Do not sort the list, hence we also don't need to clone it.
This commit is contained in:
Thomas Haller 2018-03-14 08:53:32 +01:00
parent 1d5a76140d
commit f063ab41e9

View file

@ -4555,12 +4555,10 @@ impl_manager_add_and_activate_connection (NMDBusObject *obj,
goto error;
{
gs_free NMSettingsConnection **connections = NULL;
NMSettingsConnection *const*connections;
guint i, len;
connections = nm_settings_get_connections_clone (priv->settings, &len,
NULL, NULL,
nm_settings_connection_cmp_autoconnect_priority_p_with_data, NULL);
connections = nm_settings_get_connections (priv->settings, &len);
all_connections = NULL;
for (i = len; i > 0; ) {
i--;