diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-01 06:39:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-01 06:39:48 -0700 |
commit | f58f6224e6276f729a4d29732543530d561e2020 (patch) | |
tree | a45c1716d4ae22e8ebb2bb97dd485c249458077b /tree.h | |
parent | 415bf7e8ee1a89e6a7f8c0ffc3e941f5ba232658 (diff) | |
download | txr-f58f6224e6276f729a4d29732543530d561e2020.tar.gz txr-f58f6224e6276f729a4d29732543530d561e2020.tar.bz2 txr-f58f6224e6276f729a4d29732543530d561e2020.zip |
tree: bug in key handling in insertion.
* tree.c (tr_insert): We must apply the key_fn to the key of
the node which we are inserting, not only to the tree node
being searched. This is different from delete, where the key
argument is just the key value to be searched for, not a key
object from which the key function extracts the key value.
Variable naming is hereby adjusted: let's use tr_key for the
key from the tree, and tn_key for the key extracted from the
argument node.
(tn_lookup, tr_delete): Rename the tn_key local variable to
tr_key, for consistency with the naming inside tr_insert.
Diffstat (limited to 'tree.h')
0 files changed, 0 insertions, 0 deletions