mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-25 04:50:37 +01:00
libnm: optimize nm_simple_connection_new_clone() to not needlessly set the path
Server never sets the path, so this is entirely unused server-side. Also NMConnection is a glib interface and stores it's private date in the GObject's data. It's less efficient to look it up. Just avoid it.
This commit is contained in:
parent
755c8bb30f
commit
de5d07392d
1 changed files with 6 additions and 1 deletions
|
|
@ -113,11 +113,16 @@ NMConnection *
|
|||
nm_simple_connection_new_clone (NMConnection *connection)
|
||||
{
|
||||
NMConnection *clone;
|
||||
const char *path;
|
||||
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
|
||||
|
||||
clone = nm_simple_connection_new ();
|
||||
nm_connection_set_path (clone, nm_connection_get_path (connection));
|
||||
|
||||
path = nm_connection_get_path (connection);
|
||||
if (path)
|
||||
nm_connection_set_path (clone, path);
|
||||
|
||||
nm_connection_replace_settings_from_connection (clone, connection);
|
||||
|
||||
return clone;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue