]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
tree: Don't check if we need to fill the stack
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 6 Mar 2024 22:46:44 +0000 (22:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 6 Mar 2024 22:46:44 +0000 (22:46 +0000)
If the stack is empty, the for loop won't run and we will straight go to
where we push the network onto the stack.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/network-tree.c

index fcc42399783698a3745259df3e2bbd45d7b6cd9d..70966251b597608ad50bbd4f9d05df520e4656a9 100644 (file)
@@ -488,10 +488,6 @@ static int loc_network_tree_dedup_step(struct loc_network* network, void* data)
        struct loc_network* n = NULL;
        int r;
 
-       // First call when we have not seen any networks, yet
-       if (loc_network_list_empty(ctx->stack))
-               return loc_network_list_push(ctx->stack, network);
-
        // Walk through all networks on the stack...
        for (int i = loc_network_list_size(ctx->stack) - 1; i >= 0; i--) {
                n = loc_network_list_get(ctx->stack, i);