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

Unified Diff: Source/core/dom/shadow/InsertionPoint.cpp

Issue 23766020: Trivial changes to default Vector sizing in the shadow area. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tidying up. Created 7 years, 3 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 | « Source/core/dom/shadow/ElementShadow.cpp ('k') | Source/wtf/Vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/InsertionPoint.cpp
diff --git a/Source/core/dom/shadow/InsertionPoint.cpp b/Source/core/dom/shadow/InsertionPoint.cpp
index 4c2b26d99e96bf422c533c70151646b97a90e52d..7d05daaf2b336d464a6778eca6fd33cef156edba 100644
--- a/Source/core/dom/shadow/InsertionPoint.cpp
+++ b/Source/core/dom/shadow/InsertionPoint.cpp
@@ -92,6 +92,7 @@ void InsertionPoint::setDistribution(ContentDistribution& distribution)
distribution.at(j)->lazyReattachIfAttached();
m_distribution.swap(distribution);
+ m_distribution.shrinkToFit();
}
void InsertionPoint::attach(const AttachContext& context)
@@ -146,8 +147,9 @@ PassRefPtr<NodeList> InsertionPoint::getDistributedNodes()
document().updateDistributionForNodeIfNeeded(this);
Vector<RefPtr<Node> > nodes;
+ nodes.reserveInitialCapacity(m_distribution.size());
for (size_t i = 0; i < m_distribution.size(); ++i)
- nodes.append(m_distribution.at(i));
+ nodes.uncheckedAppend(m_distribution.at(i));
return StaticNodeList::adopt(nodes);
}
« no previous file with comments | « Source/core/dom/shadow/ElementShadow.cpp ('k') | Source/wtf/Vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698