settings: reorder checks in _delete_volatile_connection_do() to perform cheaper check first

Checking whether a settings connection is still tracked is a simple
c_list_is_empty(). It's faster, so do it first.
This commit is contained in:
Thomas Haller
2019-06-20 17:14:30 +02:00
parent 50e193d12c
commit 6d4592354f

View File

@@ -817,14 +817,14 @@ _delete_volatile_connection_do (NMManager *self,
if (!NM_FLAGS_HAS (nm_settings_connection_get_flags (connection),
NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE))
return;
if (!nm_settings_has_connection (priv->settings, connection))
return;
if (active_connection_find (self,
connection,
NULL,
NM_ACTIVE_CONNECTION_STATE_DEACTIVATED,
NULL))
return;
if (!nm_settings_has_connection (priv->settings, connection))
return;
_LOGD (LOGD_DEVICE, "volatile connection disconnected. Deleting connection '%s' (%s)",
nm_settings_connection_get_id (connection), nm_settings_connection_get_uuid (connection));