aboutsummaryrefslogtreecommitdiffstats
path: root/src/tree.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tree.c b/src/tree.c
index 63bed7f41..9462d2a2c 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -23,7 +23,7 @@
#include <string.h>
#ifndef CHILDREN_PER_NODE
-#define CHILDREN_PER_NODE 31
+#define CHILDREN_PER_NODE 25
#endif
#define DATA_PER_NODE (CHILDREN_PER_NODE-1)
@@ -121,6 +121,7 @@ _Find(TreeIterator * iter, void * key)
{
if (_FindPosition(iter->tree, iter->node, key, &iter->which))
{
+ iter->which++;
return 1;
}
@@ -351,7 +352,7 @@ void
_DeleteAt(TreeIterator * iter)
{
TreeNode * node = iter->node;
- int pos = iter->which;
+ int pos = iter->which - 1;
TreeKeyData * keyData = &(node->keyData[pos]);
TreeKeyData keyDataToFree = *keyData;
@@ -704,7 +705,6 @@ FindInTree(Tree * tree, void * key, TreeIterator * iter)
_SetIteratorToRoot(tree, iter);
if (_Find(iter, key))
{
- iter->which++;
return 1;
}