diff options
author | Thomas Haller <thaller@redhat.com> | 2018-03-14 08:57:42 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-03-20 15:08:18 +0100 |
commit | e17cd1d742c47122b159040ce23fbf684b21c486 (patch) | |
tree | 5d3cee96a3068eb39539a61c52e5b989c2010969 /src/devices/adsl | |
parent | f063ab41e96b1b62719837a51f71ac1d44c44b10 (diff) | |
download | NetworkManager-e17cd1d742c47122b159040ce23fbf684b21c486.tar.gz |
core: avoid clone of all-connections list for nm_utils_complete_generic()
NMSettings exposes a cached list of all connection. We don't need
to clone it. Note that this is not save against concurrent modification,
meaning, add/remove of connections in NMSettings will invalidate the
list.
However, it wasn't save against that previously either, because
altough we cloned the container (GSList), we didn't take an additional
reference to the elements.
This is purely a performance optimization, we don't need to clone the
list. Also, since the original list is of type "NMConnection *const*",
use that type insistently, instead of dependent API requiring GSList.
IMO, GSList is anyway not a very nice API for many use cases because
it requires an additional slice allocation for each element. It's
slower, and often less convenient to use.
Diffstat (limited to 'src/devices/adsl')
-rw-r--r-- | src/devices/adsl/nm-device-adsl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index ed7b868d24..9133137682 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -114,7 +114,7 @@ static gboolean complete_connection (NMDevice *device, NMConnection *connection, const char *specific_object, - const GSList *existing_connections, + NMConnection *const*existing_connections, GError **error) { NMSettingAdsl *s_adsl; |