Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: ui/base/models/tree_node_model.h

Issue 8511065: ui/base/models: Use operator '->' for accessing std::vector elements in TreeNode class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/models/tree_node_model.h
diff --git a/ui/base/models/tree_node_model.h b/ui/base/models/tree_node_model.h
index 38062a39234b5fb4cdd3ee48cc280affc7a8e926..1fe59d9cd69683878d55d20d817199027a8c4bc7 100644
--- a/ui/base/models/tree_node_model.h
+++ b/ui/base/models/tree_node_model.h
@@ -71,12 +71,12 @@ class TreeNode : public TreeModelNode {
virtual ~TreeNode() {}
- // Adds |node| as a child of this one, at |index|.
+ // Adds |node| as a child of this node, at |index|.
virtual void Add(NodeType* node, int index) {
DCHECK(node);
DCHECK_GE(index, 0);
DCHECK_LE(index, child_count());
- // If the node has a parent, remove it from its parent.
+ // If |node| has a parent, remove it from its parent.
NodeType* parent = node->parent_;
if (parent)
parent->Remove(node);
@@ -89,7 +89,7 @@ class TreeNode : public TreeModelNode {
virtual NodeType* Remove(NodeType* node) {
typename std::vector<NodeType*>::iterator i =
std::find(children_->begin(), children_->end(), node);
- DCHECK(i != children_.end());
+ DCHECK(i != children_->end());
node->parent_ = NULL;
children_->erase(i);
return node;
@@ -113,7 +113,7 @@ class TreeNode : public TreeModelNode {
int child_count() const { return static_cast<int>(children_->size()); }
// Returns true if this node has no children.
- bool empty() const { return children_.empty(); }
+ bool empty() const { return children_->empty(); }
// Returns the number of all nodes in the subtree rooted at this node,
// including this node.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698