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

Unified Diff: Source/core/dom/ContainerNode.cpp

Issue 171953002: Get rid of inefficient uses of childNodeCount() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Small clean up Created 6 years, 10 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 | « no previous file | Source/core/dom/Range.cpp » ('j') | Source/core/dom/Range.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContainerNode.cpp
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index d63b98e908235bd54bd1ea1d68fd517d04e89bab..f1b91faa149f45d0ac1ecf76ff5c3163f33ce5ca 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -537,7 +537,6 @@ void ContainerNode::removeChildren()
RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates;
{
NoEventDispatchAssertion assertNoEventDispatch;
- removedChildren.reserveInitialCapacity(childNodeCount());
Inactive 2014/02/19 04:13:33 I don't think this one is worth it as we end up tr
eseidel 2014/02/19 05:39:54 I expect walking the child list twice may be cheap
Inactive 2014/02/19 14:28:15 Ok then. I prefer to keep this change out of the C
while (m_firstChild) {
removedChildren.append(m_firstChild);
removeBetween(0, m_firstChild->nextSibling(), *m_firstChild);
« no previous file with comments | « no previous file | Source/core/dom/Range.cpp » ('j') | Source/core/dom/Range.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698