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

Unified Diff: third_party/WebKit/Source/core/css/CSSSelectorList.cpp

Issue 2774663003: Simplify the SelectorQuery constructor and reuse CSSSelectorList::length(). (Closed)
Patch Set: woops Created 3 years, 9 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: third_party/WebKit/Source/core/css/CSSSelectorList.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
index 3af0331d4de6e3511d0f4ab04f116e8fecdd0721..7cac8c8734fca7f7557048875b940980b9a2da81 100644
--- a/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSelectorList.cpp
@@ -44,7 +44,7 @@ namespace blink {
CSSSelectorList CSSSelectorList::copy() const {
CSSSelectorList list;
- unsigned length = this->length();
+ unsigned length = this->computeLength();
list.m_selectorArray =
reinterpret_cast<CSSSelector*>(WTF::Partitions::fastMalloc(
sizeof(CSSSelector) * length, kCSSSelectorTypeName));
@@ -94,7 +94,7 @@ CSSSelectorList CSSSelectorList::adoptSelectorVector(
return list;
}
-unsigned CSSSelectorList::length() const {
+unsigned CSSSelectorList::computeLength() const {
if (!m_selectorArray)
return 0;
CSSSelector* current = m_selectorArray;
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSelectorList.h ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698