Commit 92202e5a authored by Michael Tremer's avatar Michael Tremer

network-list: Exit find operation early when the list is empty

Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 7c78416c
......@@ -134,6 +134,10 @@ LOC_EXPORT struct loc_network* loc_network_list_get(struct loc_network_list* lis
static off_t loc_network_list_find(struct loc_network_list* list,
struct loc_network* network, int* found) {
// Insert at the beginning for an empty list
if (loc_network_list_empty(list))
return 0;
off_t lo = 0;
off_t hi = list->size - 1;
int result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment