mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
wifi: don't unnecessarily trim tracked ssid list
Only _scan_request_ssids_track() adds elements to the list, and that already trims the list to a maxium length. In all other cases, we never expect a need to trim the list.
This commit is contained in:
parent
a0e115cb44
commit
3af9209d47
|
@ -262,10 +262,10 @@ _scan_request_ssids_remove_all (NMDeviceWifiPrivate *priv,
|
|||
d = c_list_last_entry (&priv->scan_request_ssids_lst_head, ScanRequestSsidData, lst);
|
||||
_scan_request_ssids_remove (priv, d, NULL);
|
||||
}
|
||||
nm_assert (i == nm_g_hash_table_size (priv->scan_request_ssids_hash));
|
||||
nm_assert (i == c_list_length (&priv->scan_request_ssids_lst_head));
|
||||
nm_assert (i <= cutoff_at_len);
|
||||
}
|
||||
|
||||
nm_assert (nm_g_hash_table_size (priv->scan_request_ssids_hash) <= SCAN_REQUEST_SSIDS_MAX_NUM);
|
||||
nm_assert (nm_g_hash_table_size (priv->scan_request_ssids_hash) == c_list_length (&priv->scan_request_ssids_lst_head));
|
||||
}
|
||||
|
||||
static GPtrArray *
|
||||
|
@ -275,11 +275,9 @@ _scan_request_ssids_fetch (NMDeviceWifiPrivate *priv, gint64 now_msec)
|
|||
GPtrArray *ssids;
|
||||
guint len;
|
||||
|
||||
_scan_request_ssids_remove_all (priv, now_msec, SCAN_REQUEST_SSIDS_MAX_NUM);
|
||||
_scan_request_ssids_remove_all (priv, now_msec, G_MAXUINT);
|
||||
|
||||
len = nm_g_hash_table_size (priv->scan_request_ssids_hash);
|
||||
nm_assert (len == c_list_length (&priv->scan_request_ssids_lst_head));
|
||||
|
||||
if (len == 0)
|
||||
return NULL;
|
||||
|
||||
|
@ -1702,7 +1700,7 @@ _scan_kickoff (NMDeviceWifi *self)
|
|||
|
||||
now_msec = nm_utils_get_monotonic_timestamp_msec ();
|
||||
|
||||
_scan_request_ssids_remove_all (priv, now_msec, SCAN_REQUEST_SSIDS_MAX_NUM);
|
||||
_scan_request_ssids_remove_all (priv, now_msec, G_MAXUINT);
|
||||
|
||||
device_state = nm_device_get_state (NM_DEVICE (self));
|
||||
if ( device_state > NM_DEVICE_STATE_DISCONNECTED
|
||||
|
|
Loading…
Reference in a new issue