diff options
Diffstat (limited to 'filter/tree.c')
-rw-r--r-- | filter/tree.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/filter/tree.c b/filter/tree.c index 5da86b9d..97bf7dae 100644 --- a/filter/tree.c +++ b/filter/tree.c @@ -134,6 +134,14 @@ same_tree(const struct f_tree *t1, const struct f_tree *t2) return 1; } +int +tree_node_count(const struct f_tree *t) +{ + if (t == NULL) + return 0; + + return 1 + tree_node_count(t->left) + tree_node_count(t->right); +} static void tree_node_format(const struct f_tree *t, buffer *buf) |