Commit 4a253e12 authored by Francis Dupont's avatar Francis Dupont

commit rt17451

parent 3e072511
2347. [bug] Delete now traverses the RB tree in the canonical
order. [RT #17451]
2346. [func] Memory statistics now cover all active memory contexts
in increased detail. [RT #17580]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbt.c,v 1.140 2008/01/22 23:28:04 tbox Exp $ */
/* $Id: rbt.c,v 1.141 2008/03/31 13:11:32 fdupont Exp $ */
/*! \file */
......@@ -2056,10 +2056,6 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
node = LEFT(node);
goto traverse;
}
if (RIGHT(node) != NULL) {
node = RIGHT(node);
goto traverse;
}
if (DOWN(node) != NULL) {
node = DOWN(node);
goto traverse;
......@@ -2076,14 +2072,15 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
node->magic = 0;
#endif
parent = PARENT(node);
if (RIGHT(node) != NULL)
PARENT(RIGHT(node)) = parent;
if (parent != NULL) {
if (LEFT(parent) == node)
LEFT(parent) = NULL;
LEFT(parent) = RIGHT(node);
else if (DOWN(parent) == node)
DOWN(parent) = NULL;
else if (RIGHT(parent) == node)
RIGHT(parent) = NULL;
}
DOWN(parent) = RIGHT(node);
} else
parent = RIGHT(node);
isc_mem_put(rbt->mctx, node, NODE_SIZE(node));
rbt->nodecount--;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment