Skip to content
  • Thomas Haller's avatar
    core: avoid clone of all-connections list for nm_utils_complete_generic() · e17cd1d7
    Thomas Haller authored
    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.
    e17cd1d7