Skip to content
  • Thomas Haller's avatar
    libnm: streamline functions in nm-connection.c · 4c094adf
    Thomas Haller authored
    Functions call each other, like
    
      nm_connection_get_id()
        nm_connection_get_setting_connection()
          nm_connection_get_setting()
    
    Along the way, each function asserts that the input argument
    is of type NMConnection via
    
        g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
    
    Avoid such duplicate assertions when we already verifyied the
    input argument.
    
    For example, in case of nm_connection_get_id(), don't check just call
    nm_connection_get_setting_connection() right away. It already
    asserts.
    
    The downside is, that the assertion no longer fails in the function
    that immediately called it. But these are assertions after all.
    4c094adf