aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bstree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bstree.c b/src/bstree.c
index f0312a8..7d4f14f 100644
--- a/src/bstree.c
+++ b/src/bstree.c
@@ -107,13 +107,13 @@ bstree_min(struct bstnode *node)
struct bstnode *
bstree_successor(struct bstnode *na)
{
- bstree_xcessor(na, right, max);
+ bstree_xcessor(na, right, min);
}
struct bstnode *
bstree_predecessor(struct bstnode *na)
{
- bstree_xcessor(na, left, min);
+ bstree_xcessor(na, left, max);
}
bool
@@ -124,7 +124,7 @@ bstree_inorder_walk(struct bstnode *node, bst_walk_cb cb, void *data)
}
if (!cb(node, data)) return false;
if (node->right != NULL) {
- if (!bstree_inorder_walk(node->right, cb, data)) return false;
+ return bstree_inorder_walk(node->right, cb, data);
}
return true;
}