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

Unified Diff: cc/base/rtree.cc

Issue 2871183002: Use emplace_back in RTree::Build (Closed)
Patch Set: Created 3 years, 7 months 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 | « cc/base/rtree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/rtree.cc
diff --git a/cc/base/rtree.cc b/cc/base/rtree.cc
index 1cb0f997cd089f7582a6de965d90b677c2d547b2..ab4b128b52b78332f5c9bb2065975c823daa1115 100644
--- a/cc/base/rtree.cc
+++ b/cc/base/rtree.cc
@@ -23,11 +23,8 @@ RTree::Node* RTree::AllocateNodeAtLevel(int level) {
// We don't allow reallocations, since that would invalidate references to
// existing nodes, so verify that capacity > size.
DCHECK_GT(nodes_.capacity(), nodes_.size());
- nodes_.emplace_back();
- Node& node = nodes_.back();
- node.num_children = 0;
- node.level = level;
- return &node;
+ nodes_.emplace_back(level);
+ return &nodes_.back();
}
RTree::Branch RTree::BuildRecursive(std::vector<Branch>* branches, int level) {
« no previous file with comments | « cc/base/rtree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698