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

Unified Diff: Source/core/dom/shadow/ContentDistribution.h

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 | « no previous file | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/ContentDistribution.h
diff --git a/Source/core/dom/shadow/ContentDistribution.h b/Source/core/dom/shadow/ContentDistribution.h
index 2fd8fc10f22fe1e22a0c3992fd94aa1084e146a4..65a221d9ea896ee0217f95d600dcfc3aaf334690 100644
--- a/Source/core/dom/shadow/ContentDistribution.h
+++ b/Source/core/dom/shadow/ContentDistribution.h
@@ -40,6 +40,8 @@ namespace WebCore {
class ContentDistribution {
public:
+ ContentDistribution() { m_nodes.reserveInitialCapacity(32); }
+
PassRefPtr<Node> first() const { return m_nodes.first(); }
PassRefPtr<Node> last() const { return m_nodes.last(); }
PassRefPtr<Node> at(size_t index) const { return m_nodes.at(index); }
@@ -49,6 +51,7 @@ public:
void append(PassRefPtr<Node>);
void clear() { m_nodes.clear(); m_indices.clear(); }
+ void shrinkToFit() { m_nodes.shrinkToFit(); }
bool contains(const Node* node) const { return m_indices.contains(node); }
size_t find(const Node*) const;
« no previous file with comments | « no previous file | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698