BIND 10 #2811: Make some DomainTree code updates
BIND 10 Development
do-not-reply at isc.org
Fri Aug 2 09:26:46 UTC 2013
#2811: Make some DomainTree code updates
-------------------------------------+-------------------------------------
Reporter: muks | Owner:
Type: enhancement | vorner
Priority: medium | Status:
Component: data source | reviewing
Keywords: | Milestone:
Sensitive: 0 | Sprint-20130806
Sub-Project: DNS | Resolution:
Estimated Difficulty: 3 | CVSS Scoring:
Total Hours: 0 | Defect Severity: N/A
| Feature Depending on Ticket:
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Changes (by muks):
* owner: muks => vorner
Comment:
Hi Michal
Replying to [comment:13 vorner]:
> Hello
>
> Just few questions. What is the motivation for this change?
> {{{#!diff
> } else if (order < 0) {
> node->setSubTreeRoot(false);
> parent->left_ = node;
> + insertRebalance(current_root, node);
> } else {
> node->setSubTreeRoot(false);
> parent->right_ = node;
> + insertRebalance(current_root, node);
> }
> - insertRebalance(current_root, node);
> +
> if (new_node != NULL) {
> }}}
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.
> Looking at the loop, shouldn't we stop it after the first rotation?
Which loop are you referring to?
> In the sorted test, I think we need 7 digits, 6 is not enough.
This was done.
I've also added a minor wrapper around the color testing code. It may be a
bit too much, but the code is simpler to read and the compiler should
inline anyway.
The new branch (based on current `master`) is `trac2811_2`. The commits on
this branch are identical up to the last review.
--
Ticket URL: <http://bind10.isc.org/ticket/2811#comment:14>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list