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

Issue 7058030: ui/base/models: Reverse the DCHECKs of index. (Closed)

Created:
9 years, 6 months ago by tfarina
Modified:
9 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews
Visibility:
Public.

Description

ui/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 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M ui/base/models/tree_node_model.h View 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
tfarina
Please, take a look.
9 years, 6 months ago (2011-06-02 21:11:26 UTC) #1
sky
9 years, 6 months ago (2011-06-02 22:16:08 UTC) #2
LGTM

Powered by Google App Engine
This is Rietveld 408576698