Descriptionui/base/models: Reverse the DCHECKs of index.
The way it's written until now is counter-intuitive. This makes it intuitive.
1 - To make sure an int index is in the array range when we are adding we should check for:
index >= 0 && index <= child_count().
So use DCHECK_GE for '>=' and DCHECK_LE for '<=' respectively.
2 - To make sure an int index is in the array range when we are retrieving it from vector we should check for:
index >= 0 && index < child_count().
So use DCHECK_GE for '>=' and DCHECK_LT for '<' respectively.
BUG=None
TEST=app_unittests --gtest_filter=TreeNodeModelTest.*
R=sky@chromium.org
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=87716
Patch Set 1 : #
Messages
Total messages: 2 (0 generated)
|