Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
Should be the name of the data structure first and then the name of
the sub-routine not the other way around.
  • Loading branch information
StefanBossbaly committed May 21, 2012
1 parent 6009492 commit a25307f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tree.c
Expand Up @@ -80,18 +80,18 @@ int tree_contains(struct tree *tree, void *data) {
return tree_contains_helper(tree->root, data, tree->compare_to);
}

void dealloc_tree_helper(struct node *node) {
void tree_dealloc_helper(struct node *node) {
if (node->left != NULL)
dealloc_tree_helper(node->left);
tree_dealloc_helper(node->left);
if (node->right != NULL)
dealloc_tree_helper(node->right);
tree_dealloc_helper(node->right);

tree_dealloc_node(node);
}

void dealloc_tree(struct tree *tree) {
void tree_dealloc(struct tree *tree) {
if (tree->root != NULL) {
dealloc_tree_helper(tree->root);
tree_dealloc_helper(tree->root);
tree_dealloc_node(tree->root);
}

Expand Down
2 changes: 1 addition & 1 deletion tree.h
Expand Up @@ -21,6 +21,6 @@ struct tree {
struct tree *tree_alloc(int (*compare_to)(void *, void *));
void tree_insert(struct tree *tree, void *data, size_t size);
int tree_contains(struct tree *tree, void *data);
void dealloc_tree(struct tree *tree);
void tree_dealloc(struct tree *tree);

#endif /* TREE_H_ */

0 comments on commit a25307f

Please sign in to comment.