diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-29 07:14:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-29 07:14:40 -0700 |
commit | bc483048cfc2c9db80f4fcca18e882d646d30510 (patch) | |
tree | 124cda8cd39785e21393903115c43d947f16b566 /tree.c | |
parent | e3642f07ef877609d45f3dc737e686957d675d8a (diff) | |
download | txr-bc483048cfc2c9db80f4fcca18e882d646d30510.tar.gz txr-bc483048cfc2c9db80f4fcca18e882d646d30510.tar.bz2 txr-bc483048cfc2c9db80f4fcca18e882d646d30510.zip |
tree: incorrect lookup function.
* tree.c (tn_lookup): The right case is incorrectly
chasing the left pointer.
* tests/010/tree.tl: New file.
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -170,7 +170,7 @@ static val tn_lookup(struct tree *tr, val node, val key) funcall2(tr->equal_fn, key, tr_key))) { return node; } else { - return if2(node->tn.left, tn_lookup(tr, node->tn.left, key)); + return if2(node->tn.right, tn_lookup(tr, node->tn.right, key)); } } |