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

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: 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
Index: Source/core/dom/shadow/InsertionPoint.cpp
diff --git a/Source/core/dom/shadow/InsertionPoint.cpp b/Source/core/dom/shadow/InsertionPoint.cpp
index 9ef0d29b0dd90e0907685d302254522a61040af9..eff61794266d40f3b0b802870d6afec4f72e2689 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);
}

Powered by Google App Engine
This is Rietveld 408576698