Commit 01404156 authored by Daniel Salzman's avatar Daniel Salzman

zone-tree: rename zone_tree_weight zone_tree_count

parent 90d3d6fb
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -27,14 +27,18 @@ zone_tree_t* zone_tree_create()
return hattrie_create();
}
size_t zone_tree_weight(const zone_tree_t* tree)
size_t zone_tree_count(const zone_tree_t *tree)
{
if (tree == NULL) {
return 0;
}
return hattrie_weight(tree);
}
int zone_tree_is_empty(const zone_tree_t *tree)
{
return zone_tree_weight(tree) == 0;
return zone_tree_count(tree) == 0;
}
int zone_tree_insert(zone_tree_t *tree, zone_node_t *node)
......
......@@ -42,11 +42,11 @@ typedef int (*zone_tree_apply_cb_t)(zone_node_t **node, void *data);
zone_tree_t* zone_tree_create(void);
/*!
* \brief Return weight of the zone tree (number of nodes).
* \brief Return number of nodes in the zone tree.
* \param tree Zone tree.
* \return number of nodes in tree.
*/
size_t zone_tree_weight(const zone_tree_t* tree);
size_t zone_tree_count(const zone_tree_t *tree);
/*!
* \brief Checks if the zone tree is empty.
......
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