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

Unified Diff: Source/core/layout/TextAutosizer.cpp

Issue 1062283002: Use C++11 range-based loop for core/layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix it naming Created 5 years, 8 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: Source/core/layout/TextAutosizer.cpp
diff --git a/Source/core/layout/TextAutosizer.cpp b/Source/core/layout/TextAutosizer.cpp
index 0ddacbaadf4f32dcc1de1e985d18bedb7d38c5fa..bf376f33c8303df1a54bfa133d0ba6803672e559 100644
--- a/Source/core/layout/TextAutosizer.cpp
+++ b/Source/core/layout/TextAutosizer.cpp
@@ -787,9 +787,8 @@ bool TextAutosizer::superclusterHasEnoughTextToAutosize(Supercluster* superclust
if (supercluster->m_hasEnoughTextToAutosize != UnknownAmountOfText)
return supercluster->m_hasEnoughTextToAutosize == HasEnoughText;
- BlockSet::iterator end = supercluster->m_roots->end();
- for (BlockSet::iterator it = supercluster->m_roots->begin(); it != end; ++it) {
- if (clusterWouldHaveEnoughTextToAutosize(*it, widthProvider)) {
+ for (auto* root : *supercluster->m_roots) {
+ if (clusterWouldHaveEnoughTextToAutosize(root, widthProvider)) {
supercluster->m_hasEnoughTextToAutosize = HasEnoughText;
return true;
}
@@ -824,8 +823,8 @@ const LayoutBlock* TextAutosizer::maxClusterWidthProvider(const Supercluster* su
float maxWidth = widthFromBlock(result);
const BlockSet* roots = supercluster->m_roots;
- for (BlockSet::iterator it = roots->begin(); it != roots->end(); ++it) {
- const LayoutBlock* widthProvider = clusterWidthProvider(*it);
+ for (const auto* root : *roots) {
+ const LayoutBlock* widthProvider = clusterWidthProvider(root);
if (widthProvider->needsLayout())
continue;
float width = widthFromBlock(widthProvider);
« no previous file with comments | « Source/core/layout/SubtreeLayoutScope.cpp ('k') | Source/core/layout/compositing/DeprecatedPaintLayerCompositor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698