platform: make "idx" argument in _addr_array_clean_expired() mandatory

There is only one caller of _addr_array_clean_expired(), and it always
provides the "idx" pointer.
This commit is contained in:
Thomas Haller
2022-03-29 12:32:16 +02:00
parent 305f11069f
commit de9f174d51

View File

@@ -3741,14 +3741,13 @@ _addr_array_clean_expired(int addr_family,
if (!nmp_utils_lifetime_get(a->timestamp, a->lifetime, a->preferred, now, NULL))
goto clear_and_next;
if (idx) {
if (G_UNLIKELY(!*idx)) {
*idx = g_hash_table_new((GHashFunc) nmp_object_id_hash,
(GEqualFunc) nmp_object_id_equal);
*idx =
g_hash_table_new((GHashFunc) nmp_object_id_hash, (GEqualFunc) nmp_object_id_equal);
}
if (!g_hash_table_add(*idx, (gpointer) NMP_OBJECT_UP_CAST(a)))
nm_assert_not_reached();
}
any_addrs = TRUE;
continue;