mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 15:20:11 +01:00
manager: reorder conditions in unmanaged_to_disconnected() to check cheaper condition first
Getting nm_device_get_state() is cheap, contrary to nm_device_is_available().
Reorder the checks.
(cherry picked from commit 6075348f0f)
This commit is contained in:
parent
8c0f322892
commit
9da9f22fed
1 changed files with 2 additions and 2 deletions
|
|
@ -3563,8 +3563,8 @@ unmanaged_to_disconnected (NMDevice *device)
|
|||
NM_DEVICE_STATE_REASON_USER_REQUESTED);
|
||||
}
|
||||
|
||||
if ( nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST)
|
||||
&& (nm_device_get_state (device) == NM_DEVICE_STATE_UNAVAILABLE)) {
|
||||
if ( nm_device_get_state (device) == NM_DEVICE_STATE_UNAVAILABLE
|
||||
&& nm_device_is_available (device, NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST)) {
|
||||
nm_device_state_changed (device,
|
||||
NM_DEVICE_STATE_DISCONNECTED,
|
||||
NM_DEVICE_STATE_REASON_USER_REQUESTED);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue