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

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

Issue 645743003: Use C++11 range-based loop for core/css (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: better variable names Created 6 years, 2 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 | « Source/core/css/RemoteFontFaceSource.cpp ('k') | Source/core/css/SelectorChecker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleSet.cpp
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index db2f3ffebdcfead54596218be18fcc4450f9e249..6cf0f6e24d0c974cb8584b64b34221f0dd735749 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -331,10 +331,9 @@ void RuleSet::addStyleRule(StyleRule* rule, AddRuleFlags addRuleFlags)
void RuleSet::compactPendingRules(PendingRuleMap& pendingMap, CompactRuleMap& compactMap)
{
- PendingRuleMap::iterator end = pendingMap.end();
- for (PendingRuleMap::iterator it = pendingMap.begin(); it != end; ++it) {
- OwnPtrWillBeRawPtr<WillBeHeapLinkedStack<RuleData> > pendingRules = it->value.release();
- CompactRuleMap::ValueType* compactRules = compactMap.add(it->key, nullptr).storedValue;
+ for (auto& item : pendingMap) {
+ OwnPtrWillBeRawPtr<WillBeHeapLinkedStack<RuleData> > pendingRules = item.value.release();
+ CompactRuleMap::ValueType* compactRules = compactMap.add(item.key, nullptr).storedValue;
WillBeHeapTerminatedArrayBuilder<RuleData> builder(compactRules->value.release());
builder.grow(pendingRules->size());
@@ -416,8 +415,8 @@ void RuleSet::trace(Visitor* visitor)
#ifndef NDEBUG
void RuleSet::show()
{
- for (WillBeHeapVector<RuleData>::const_iterator it = m_allRules.begin(); it != m_allRules.end(); ++it)
- it->selector().show();
+ for (const auto& rule: m_allRules)
+ rule.selector().show();
}
#endif
« no previous file with comments | « Source/core/css/RemoteFontFaceSource.cpp ('k') | Source/core/css/SelectorChecker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698