diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-12-18 13:22:11 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-12-18 13:22:11 -0800 |
commit | 8248110871d18e9ceed422076de5e36bf212e127 (patch) | |
tree | 811a88bc0646c39aad677ba2b045acfdd396e058 /stdlib/doc-syms.tl | |
parent | 236a11759c4f0ccdd809621a990da2e0ae138def (diff) | |
download | txr-8248110871d18e9ceed422076de5e36bf212e127.tar.gz txr-8248110871d18e9ceed422076de5e36bf212e127.tar.bz2 txr-8248110871d18e9ceed422076de5e36bf212e127.zip |
tree: bugfix wrong tree-count.
When duplicate keys are inserted in the default way with
replacement, the tree size must not be incremented.
* tree.c (tr_insert): Increment the tr->size and maintain
tr->max_size here. In the case of replacing an existing node,
do not touch the count.
* tests/010/tree.tl: Add test cases covering duplicate
insertion and tree-count.
(tree_insert_node): Remove unconditional size increment.
Diffstat (limited to 'stdlib/doc-syms.tl')
0 files changed, 0 insertions, 0 deletions