nmcli: move an assignment down to where the value needed

It's happier there. No change in behavior.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1317
This commit is contained in:
Lubomir Rintel 2022-07-29 00:03:26 +02:00
parent a3ce5aa50e
commit d3d1cd2b3e

View file

@ -539,8 +539,6 @@ nmc_find_active_connection(const GPtrArray *active_cons,
NMActiveConnection *candidate = g_ptr_array_index(active_cons, i);
const char *v, *v_num;
con = nm_active_connection_get_connection(candidate);
/* When filter_type is NULL, compare connection ID (filter_val)
* against all types. Otherwise, only compare against the specific
* type. If 'path' or 'apath' filter types are specified, comparison
@ -562,6 +560,8 @@ nmc_find_active_connection(const GPtrArray *active_cons,
goto found;
}
con = nm_active_connection_get_connection(candidate);
if (NM_IN_STRSET(filter_type, NULL, "path")) {
v = con ? nm_connection_get_path(NM_CONNECTION(con)) : NULL;
v_num = nm_utils_dbus_path_get_last_component(v);