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

Unified Diff: Source/core/css/SelectorChecker.cpp

Issue 177613003: Consistently cache ElementData::length() before loops (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test failure 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/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index e1c75c37da6af45b1bd2bcb5daf6561892587cfb..7dbc1f69849e290ff350b5cbcb62cb2f52f279e9 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -440,7 +440,8 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons
const AtomicString& selectorValue = selector.value();
- for (size_t i = 0; i < element.attributeCount(); ++i) {
+ unsigned attributeCount = element.attributeCount();
+ for (size_t i = 0; i < attributeCount; ++i) {
const Attribute* attributeItem = element.attributeItem(i);
if (!attributeItem->matches(selectorAttr))
« no previous file with comments | « no previous file | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698