network: replace l_queue_get_entries loop

After adding network_bss_update, network now has a match_addr
queue function which can be used to replace an unneeded
l_queue_get_entries loop with l_queue_find.
This commit is contained in:
James Prestwood 2021-03-15 12:15:28 -07:00 committed by Denis Kenzior
parent 88d0a6a7c0
commit 4577ee01f2
1 changed files with 1 additions and 11 deletions

View File

@ -712,17 +712,7 @@ struct scan_bss *network_bss_list_pop(struct network *network)
struct scan_bss *network_bss_find_by_addr(struct network *network,
const uint8_t *addr)
{
const struct l_queue_entry *bss_entry;
for (bss_entry = l_queue_get_entries(network->bss_list); bss_entry;
bss_entry = bss_entry->next) {
struct scan_bss *bss = bss_entry->data;
if (!memcmp(bss->addr, addr, sizeof(bss->addr)))
return bss;
}
return NULL;
return l_queue_find(network->bss_list, match_addr, addr);
}
static bool match_bss(const void *a, const void *b)