]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
network: Drop an unused function to count all networks
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Mar 2023 10:52:51 +0000 (10:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Mar 2023 10:52:51 +0000 (10:52 +0000)
Reported-by: Gisle Vanem <gvanem@online.no>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libloc/network.h
src/network.c

index 024a0f18ecd4a530bb1517b3ed50a66823af9ff6..0ad90cf227d2190542e7e479c884dd17cac31d3f 100644 (file)
@@ -81,7 +81,6 @@ int loc_network_tree_walk(struct loc_network_tree* tree,
                int(*callback)(struct loc_network* network, void* data), void* data);
 int loc_network_tree_dump(struct loc_network_tree* tree);
 int loc_network_tree_add_network(struct loc_network_tree* tree, struct loc_network* network);
-size_t loc_network_tree_count_networks(struct loc_network_tree* tree);
 size_t loc_network_tree_count_nodes(struct loc_network_tree* tree);
 
 struct loc_network_tree_node;
index 10af51ad69ed6c6e60a7211d575b0902cc5ce196..a7ee4a1694f1542a7d60477eab3fbb423cbb1c8f 100644 (file)
@@ -779,25 +779,6 @@ int loc_network_tree_add_network(struct loc_network_tree* tree, struct loc_netwo
        return 0;
 }
 
-static int __loc_network_tree_count(struct loc_network* network, void* data) {
-       size_t* counter = (size_t*)data;
-
-       // Increase the counter for each network
-       counter++;
-
-       return 0;
-}
-
-size_t loc_network_tree_count_networks(struct loc_network_tree* tree) {
-       size_t counter = 0;
-
-       int r = loc_network_tree_walk(tree, NULL, __loc_network_tree_count, &counter);
-       if (r)
-               return r;
-
-       return counter;
-}
-
 static size_t __loc_network_tree_count_nodes(struct loc_network_tree_node* node) {
        size_t counter = 1;