From: Mukund Sivaraman Date: Fri, 11 May 2012 06:05:34 +0000 (+0530) Subject: [1803] Use member variables directly instead of calls X-Git-Tag: trac2351_base~226^2~159^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d27a40e4c0cff7e670f4d0add2a7b57db230f588;p=thirdparty%2Fkea.git [1803] Use member variables directly instead of calls This keeps it consistent with usage in the rest of the file. --- diff --git a/src/lib/datasrc/rbtree.h b/src/lib/datasrc/rbtree.h index ebe67f5624..5e07d32651 100644 --- a/src/lib/datasrc/rbtree.h +++ b/src/lib/datasrc/rbtree.h @@ -1160,7 +1160,7 @@ RBTree::previousNode(RBTreeNodeChain& 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()"); } @@ -1171,12 +1171,12 @@ RBTree::previousNode(RBTreeNodeChain& 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 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::previousNode(RBTreeNodeChain& 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* current(node_path.getLastComparedNode()); + const RBNode* 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::previousNode(RBTreeNodeChain& 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