Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
42390c5e
Commit
42390c5e
authored
Aug 01, 2006
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bug when deleting songs and CHILDREN_PER_NODE > 3
git-svn-id:
https://svn.musicpd.org/mpd/trunk@4507
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
6f695b8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
tree.c
src/tree.c
+6
-8
No files found.
src/tree.c
View file @
42390c5e
...
...
@@ -384,12 +384,10 @@ _DeleteAt(TreeIterator * iter)
void
*
dataToFree
=
*
data
;
{
TreeNode
*
child
=
NULL
;
// find the least greater than data to fill the whole!
if
(
node
->
children
[
pos
+
1
])
{
child
=
node
->
children
[
++
pos
];
TreeNode
*
child
=
node
->
children
[
++
pos
];
while
(
child
->
children
[
0
])
{
pos
=
0
;
...
...
@@ -403,7 +401,7 @@ _DeleteAt(TreeIterator * iter)
// or the greatest lesser than data to fill the whole!
else
if
(
node
->
children
[
pos
])
{
child
=
node
->
children
[
pos
];
TreeNode
*
child
=
node
->
children
[
pos
];
while
(
child
->
children
[
child
->
dataCount
])
{
pos
=
child
->
dataCount
;
...
...
@@ -427,12 +425,12 @@ _DeleteAt(TreeIterator * iter)
// move data nodes over, we're at a leaf node, so we can ignore
// children
int
i
=
--
node
->
dataCount
;
for
(;
data
!=
&
(
node
->
data
[
i
]);
i
--
)
int
i
=
data
-
node
->
data
;
;
for
(;
i
<
node
->
dataCount
-
1
;
i
++
)
{
node
->
data
[
i
-
1
]
=
node
->
data
[
i
];
node
->
data
[
i
]
=
node
->
data
[
i
+
1
];
}
node
->
data
[
node
->
dataCount
]
=
NULL
;
node
->
data
[
--
node
->
dataCount
]
=
NULL
;
// merge the nodes from the bottom up which have too few data
while
(
node
->
dataCount
<
(
CHILDREN_PER_NODE
/
2
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment