BIND 10 #2811: Make some DomainTree code updates
BIND 10 Development
do-not-reply at isc.org
Fri Aug 2 11:15:50 UTC 2013
#2811: Make some DomainTree code updates
-------------------------------------+-------------------------------------
Reporter: muks | Owner: muks
Type: enhancement | Status:
Priority: medium | reviewing
Component: data source | Milestone:
Keywords: | Sprint-20130806
Sensitive: 0 | Resolution:
Sub-Project: DNS | CVSS Scoring:
Estimated Difficulty: 3 | Defect Severity: N/A
Total Hours: 0 | Feature Depending on Ticket:
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Changes (by vorner):
* owner: vorner => muks
Comment:
Replying to [comment:14 muks]:
> This is a minor optimization. In the specific case that the new node is
the new root of a sub-tree, calling `insertRebalance()` on it is redundant
as its main loop will exit without running and it will recolor it to BLACK
unnecessarily.
Ah, now I see. The first is else if, not only if. Then it makes sense.
> > Looking at the loop, shouldn't we stop it after the first rotation?
>
> Which loop are you referring to?
The big loop in the `insertRebalance`, the one starting with:
{{{#!c++
// The node enters this method colored RED. We assume in our
// red-black implementation that NULL values in left and right
// children are BLACK.
//
// Case 1. If node is at the subtree root, we don't need to change
// its position in the tree. We re-color it BLACK further below
// (right before we return).
while (node != (*subtree_root).get()) {
// Case 2. If the node is not subtree root, but its parent is
// colored BLACK, then we're done. This is because the new node
// introduces a RED node in the path through it (from its
// subtree root to its children colored BLACK) but doesn't
// change the red-black properties.
}}}
In the case 4, it rotates the tree. I had the impression that once we
rotate, the whole update rebalancing ends.
--
Ticket URL: <http://bind10.isc.org/ticket/2811#comment:15>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list