BIND 10 trac1803, updated. 906ba788fd5c8fb08f4cf2717e0fbccdca4850ff [1803] Use isEmpty() instead of checking the level count

BIND 10 source code commits bind10-changes at lists.isc.org
Fri May 11 06:22:58 UTC 2012


The branch, trac1803 has been updated
       via  906ba788fd5c8fb08f4cf2717e0fbccdca4850ff (commit)
       via  d27a40e4c0cff7e670f4d0add2a7b57db230f588 (commit)
       via  a584d5c1242a8b82be7eca4af4da85319d5cfbfd (commit)
      from  d305cc8c84239d6fce7f53188b59d1b8829c64a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 906ba788fd5c8fb08f4cf2717e0fbccdca4850ff
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri May 11 11:35:55 2012 +0530

    [1803] Use isEmpty() instead of checking the level count

commit d27a40e4c0cff7e670f4d0add2a7b57db230f588
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri May 11 11:35:34 2012 +0530

    [1803] Use member variables directly instead of calls
    
    This keeps it consistent with usage in the rest of the file.

commit a584d5c1242a8b82be7eca4af4da85319d5cfbfd
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri May 11 11:33:18 2012 +0530

    [1803] Make minor comment fixes

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/rbtree.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/rbtree.h b/src/lib/datasrc/rbtree.h
index 35d2ff1..9803bad 100644
--- a/src/lib/datasrc/rbtree.h
+++ b/src/lib/datasrc/rbtree.h
@@ -1160,9 +1160,9 @@ RBTree<T>::previousNode(RBTreeNodeChain<T>& node_path) const {
         // anyway.
         return (NULL);
     }
-    if (node_path.getLastComparedNode() == NULL) {
+    if (node_path.last_compared_ == NULL) {
         isc_throw(isc::BadValue,
-                  "RBTree::previousNode called before find");
+                  "RBTree::previousNode() called before find()");
     }
 
     // If the relation isn't EQUAL, it means the find was called previously
@@ -1171,12 +1171,12 @@ RBTree<T>::previousNode(RBTreeNodeChain<T>& node_path) const {
     //
     // The logic here is not too complex, we just need to take care to handle
     // all the cases and decide where to go from there.
-    switch (node_path.getLastComparisonResult().getRelation()) {
+    switch (node_path.last_comparison_.getRelation()) {
         case dns::NameComparisonResult::COMMONANCESTOR:
             // We compared with a leaf in the tree and wanted to go to one of
-            // the sons. But the son was not there. It now depends on the
+            // the children. But the child was not there. It now depends on the
             // direction in which we wanted to go.
-            if (node_path.getLastComparisonResult().getOrder() < 0) {
+            if (node_path.last_comparison_.getOrder() < 0) {
                 // We wanted to go left. So the one we compared with is
                 // the one higher than we wanted. If we just put it into
                 // the node_path, then the following algorithm below will find
@@ -1190,7 +1190,7 @@ RBTree<T>::previousNode(RBTreeNodeChain<T>& node_path) const {
                 // compared one (it is either the compared one, or some
                 // subdomain of it). There probably is not an easy trick
                 // for this, so we just find the correct place.
-                const RBNode<T>* current(node_path.getLastComparedNode());
+                const RBNode<T>* current(node_path.last_compared_);
                 while (current != NULLNODE) {
                     node_path.push(current);
                     // Go a level down and as much right there as possible
@@ -1216,7 +1216,7 @@ RBTree<T>::previousNode(RBTreeNodeChain<T>& node_path) const {
             // only part of it. The node itself is larger than we wanted, but
             // if we put it to the node_path and then go one step left from it,
             // we get the correct result.
-            node_path.push(node_path.getLastComparedNode());
+            node_path.push(node_path.last_compared_);
             // Correct the comparison result, so we won't trigger this case
             // next time previousNode is called. We already located the correct
             // place to start. The value is partly nonsense, but that doesn't
@@ -1241,7 +1241,7 @@ RBTree<T>::previousNode(RBTreeNodeChain<T>& node_path) const {
     // So, the node_path now contains the path to a node we want previous for.
     // We just need to go one step left.
 
-    if (node_path.getLevelCount() == 0) {
+    if (node_path.isEmpty()) {
         // We got past the first one. So, we're returning NULL from
         // now on.
         return (NULL);
@@ -1256,7 +1256,7 @@ RBTree<T>::previousNode(RBTreeNodeChain<T>& node_path) const {
         // up. That one is the smaller one than us.
 
         node_path.pop();
-        if (node_path.getLevelCount() == 0) {
+        if (node_path.isEmpty()) {
             // We're past the first one
             return (NULL);
         } else {



More information about the bind10-changes mailing list