Index: app/tree_node_model.h |
diff --git a/app/tree_node_model.h b/app/tree_node_model.h |
index 0d9f2b92b1f54798de728c49561c0702934cda4f..b11bf38e3d3ed501baef76b5ad305c5905896e2e 100644 |
--- a/app/tree_node_model.h |
+++ b/app/tree_node_model.h |
@@ -82,7 +82,9 @@ class TreeNode : public TreeModelNode { |
// Adds the specified child node. |
virtual void Add(int index, NodeType* child) { |
- DCHECK(child && index >= 0 && index <= GetChildCount()); |
+ DCHECK(child); |
+ DCHECK_LE(0, index); |
+ DCHECK_GE(GetChildCount(), index); |
// If the node has a parent, remove it from its parent. |
NodeType* node_parent = child->GetParent(); |
if (node_parent) |
@@ -130,7 +132,8 @@ class TreeNode : public TreeModelNode { |
return children_[index]; |
} |
const NodeType* GetChild(int index) const { |
- DCHECK(index >= 0 && index < GetChildCount()); |
+ DCHECK_LE(0, index); |
+ DCHECK_GT(GetChildCount(), index); |
return children_[index]; |
} |