• Thomas Haller's avatar
    libnm: hash settings in NMConnection by gtype · 40476332
    Thomas Haller authored
    NMConnection keeps a list (hash table) of all settings.
    
    There are two lookup methods to find a setting in a connection:
    
      - nm_connection_get_setting() by GType
      - nm_connection_get_setting_by_name() by name
    
    Note, that nm_connection_get_setting_by_name() first converts the
    name to a GType, and then looks up the setting by GType.
    
    But then, nm_connection_get_setting() would again convert the GType to
    the type name, and hash the name. That is pointless, just index by GType
    directly.
    
    Maybe, using a hash table is anyway overkill because commonly there are
    only a handful of settings in a connection. Regardless of that, change
    the hashing.
    40476332
nm-connection.c 93.7 KB