Skip to content

Commit

Permalink
cc: Remove CHECKs for valid property tree indices
Browse files Browse the repository at this point in the history
These were added to help catch bugs and understand crashes while
property trees were being implemented.

Converting them to DCHECKs improves draw property computation time
(as measured locally on Linux using CalcDrawPropsTest cc perftests)
by about 14%.

BUG=489856
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2644603002
Cr-Commit-Position: refs/heads/master@{#444425}
  • Loading branch information
alijuma authored and Commit bot committed Jan 18, 2017
1 parent 7449a4e commit 7b6995d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cc/trees/property_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ class CC_EXPORT PropertyTree {
int Insert(const T& tree_node, int parent_id);

T* Node(int i) {
// TODO(vollick): remove this.
CHECK(i < static_cast<int>(nodes_.size()));
DCHECK(i < static_cast<int>(nodes_.size()));
return i > kInvalidNodeId ? &nodes_[i] : nullptr;
}
const T* Node(int i) const {
// TODO(vollick): remove this.
CHECK(i < static_cast<int>(nodes_.size()));
DCHECK(i < static_cast<int>(nodes_.size()));
return i > kInvalidNodeId ? &nodes_[i] : nullptr;
}

Expand Down

0 comments on commit 7b6995d

Please sign in to comment.