[svn] commit: r3524 - in /branches/trac397/src/bin/auth: rbt_datasrc.cc rbt_datasrc.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Nov 15 09:21:36 UTC 2010
Author: jinmei
Date: Mon Nov 15 09:21:35 2010
New Revision: 3524
Log:
some more editorial cleanups
Modified:
branches/trac397/src/bin/auth/rbt_datasrc.cc
branches/trac397/src/bin/auth/rbt_datasrc.h
Modified: branches/trac397/src/bin/auth/rbt_datasrc.cc
==============================================================================
--- branches/trac397/src/bin/auth/rbt_datasrc.cc (original)
+++ branches/trac397/src/bin/auth/rbt_datasrc.cc Mon Nov 15 09:21:35 2010
@@ -53,7 +53,7 @@
RBNode::successor() {
RBNode* current = this;
- /// if has right node, the successor is the left-most node
+ // if it has right node, the successor is the left-most node
if (right_ != right_->right_) {
current = right_;
while (current->left_ != current->left_->left_) {
@@ -62,8 +62,8 @@
return (current);
}
- /// otherwise return the parent without left child or
- /// current node isnot its right child
+ // otherwise return the parent without left child or
+ // current node is not its right child
RBNode* s = current->parent_;
while (s != s->left_ && current == s->right_) {
current = s;
@@ -96,8 +96,9 @@
void
RBNode::setDownTree(RBTree* down) {
down_ = down;
- if (down)
+ if (down) {
down->up_ = this;
+ }
}
/*
@@ -176,8 +177,7 @@
*tree = (RBTree*)this;
*ret = node;
return (RBTree::EXACTMATCH);
- }
- else {
+ } else {
int common_label_count = compare_result.getCommonLabels();
// common label count equal one means, there is no common between
// two names
@@ -417,13 +417,13 @@
return (1);
}
- /// cannot delete non terminal
+ // cannot delete non terminal
if (node->down_ != NULL) {
return (1);
}
tree->eraseNode(node);
- /// merge down to up
+ // merge down to up
if (tree->node_count_ == 1 && tree->up_ != NULL &&
tree->up_->isNonterminal()) {
RBNode* up = tree->up_;
@@ -464,7 +464,7 @@
if (y->parent_ == NULLNODE) {
root_ = x;
- } else if ( y == y->parent_->left_ ) {
+ } else if (y == y->parent_->left_) {
y->parent_->left_ = x;
} else {
y->parent_->right_ = x;
@@ -549,11 +549,12 @@
node->color_ = BLACK;
}
-#define INDNET(depth) do{\
- int i = 0;\
- for (; i < (depth) * 5; ++i)\
- std::cout << " ";\
-}while(0)
+#define INDNET(depth) do { \
+ int i = 0; \
+ for (; i < (depth) * 5; ++i) { \
+ std::cout << " "; \
+ } \
+} while(0)
void
RBTree::printTree(int depth) const {
Modified: branches/trac397/src/bin/auth/rbt_datasrc.h
==============================================================================
--- branches/trac397/src/bin/auth/rbt_datasrc.h (original)
+++ branches/trac397/src/bin/auth/rbt_datasrc.h Mon Nov 15 09:21:35 2010
@@ -57,14 +57,14 @@
bool isDelegate() const { return (is_delegate_); }
/// \brief return whether current domain name is non-terminal
- /// A non-terminal domain has no rrsets but at least one of its descendant
- /// domain has rrset
+ /// A non-terminal domain has no RRsets but at least one of its descendant
+ /// domain has RRset
bool isNonterminal() const { return (is_nonterminal_); }
/// \brief return the name of current node, it's relative to its parents
//
/// \todo Is it meaningful to return the absolute of the node?
- const Name &getName() const {return (name_); }
+ const Name& getName() const {return (name_); }
// \brief return next node whose name is bigger than current node
RBNode* successor();
@@ -74,11 +74,12 @@
/// \name modify function
//@{
- /// \brief add the rrset to the node
- /// \Note: there is no check whether the node already has the rrset or not
- /// and no check about whether the name of the rrset is the same with the
+ /// \brief add an RRset to the node
+ /// \Note: there is no check about whether the node already has the RRset
+ /// or not
+ /// and no check about whether the name of the RRset is the same with the
/// node or not.
- /// All of above is rely on interface user
+ /// It is the caller's responsibility to ensure these conditions.
int addRRset(RRsetPtr rrset);
//@}
More information about the bind10-changes
mailing list