aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2006-08-01 03:34:56 +0000
committerWarren Dukes <warren.dukes@gmail.com>2006-08-01 03:34:56 +0000
commit4ff98a9a94855517511eac426d3da82d0e950f0f (patch)
tree9085d52d5ead5b45c5ee337b720ea9d7fddc39dd /src
parent42390c5e3b90d9fd32fe227f4eb8501eafc27a23 (diff)
downloadmpd-4ff98a9a94855517511eac426d3da82d0e950f0f.tar.gz
mpd-4ff98a9a94855517511eac426d3da82d0e950f0f.tar.xz
mpd-4ff98a9a94855517511eac426d3da82d0e950f0f.zip
fix a bug when deleting node and CHILDREN_PER_NODE is even
git-svn-id: https://svn.musicpd.org/mpd/trunk@4508 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tree.c b/src/tree.c
index c3b2bdd71..e352aebc8 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -433,7 +433,7 @@ _DeleteAt(TreeIterator * iter)
node->data[--node->dataCount] = NULL;
// merge the nodes from the bottom up which have too few data
- while (node->dataCount < (CHILDREN_PER_NODE/2))
+ while (node->dataCount < (DATA_PER_NODE/2))
{
// if we're not the root
if (node->parent)
@@ -443,7 +443,7 @@ _DeleteAt(TreeIterator * iter)
// check siblings for extra data
if (pos < node->parent->dataCount &&
- (*(child+1))->dataCount > (CHILDREN_PER_NODE/2))
+ (*(child+1))->dataCount > (DATA_PER_NODE/2))
{
child++;
node->data[node->dataCount++] =
@@ -470,7 +470,7 @@ _DeleteAt(TreeIterator * iter)
(*child)->dataCount--;
}
else if (pos > 0 &&
- (*(child-1))->dataCount>(CHILDREN_PER_NODE/2))
+ (*(child-1))->dataCount>(DATA_PER_NODE/2))
{
child--;
int i = node->dataCount++;