Commit 153e11ee authored by Dan Williams's avatar Dan Williams

settings: small optimization

hash table already has the exported object path, no reason to ask
the connection itself for it.
parent 330cb356
......@@ -204,14 +204,14 @@ impl_settings_list_connections (NMSysconfigSettings *self,
NMSysconfigSettingsPrivate *priv = NM_SYSCONFIG_SETTINGS_GET_PRIVATE (self);
GHashTableIter iter;
gpointer data;
gpointer key;
load_connections (self);
*connections = g_ptr_array_sized_new (g_hash_table_size (priv->connections) + 1);
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, &data))
g_ptr_array_add (*connections, g_strdup (nm_connection_get_path (NM_CONNECTION (data))));
while (g_hash_table_iter_next (&iter, &key, NULL))
g_ptr_array_add (*connections, g_strdup ((const char *) key));
return TRUE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment