From e17cd1d742c47122b159040ce23fbf684b21c486 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 14 Mar 2018 08:57:42 +0100 Subject: 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. --- src/devices/wwan/nm-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/devices/wwan/nm-modem.c') diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c index 7dcbec1b41..61b7247ec8 100644 --- a/src/devices/wwan/nm-modem.c +++ b/src/devices/wwan/nm-modem.c @@ -1091,7 +1091,7 @@ nm_modem_check_connection_compatible (NMModem *self, NMConnection *connection) gboolean nm_modem_complete_connection (NMModem *self, NMConnection *connection, - const GSList *existing_connections, + NMConnection *const*existing_connections, GError **error) { NMModemClass *klass; -- cgit v1.2.1