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

Unified Diff: Source/core/layout/svg/SVGResourcesCycleSolver.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
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceGradient.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/SVGResourcesCycleSolver.cpp
diff --git a/Source/core/layout/svg/SVGResourcesCycleSolver.cpp b/Source/core/layout/svg/SVGResourcesCycleSolver.cpp
index 41f47a632081f5e06576ceb8c6731b91ba02cb55..e039405ead2181334998a6836f6f3b8811f9a704 100644
--- a/Source/core/layout/svg/SVGResourcesCycleSolver.cpp
+++ b/Source/core/layout/svg/SVGResourcesCycleSolver.cpp
@@ -86,9 +86,8 @@ bool SVGResourcesCycleSolver::resourceContainsCycles(LayoutSVGResourceContainer*
nodeResources->buildSetOfResources(nodeSet);
// Iterate resources referenced by |node|.
- ResourceSet::iterator end = nodeSet.end();
- for (ResourceSet::iterator it = nodeSet.begin(); it != end; ++it) {
- if (m_activeResources.contains(*it) || resourceContainsCycles(*it))
+ for (auto* node : nodeSet) {
+ if (m_activeResources.contains(node) || resourceContainsCycles(node))
return true;
}
}
@@ -115,10 +114,9 @@ void SVGResourcesCycleSolver::resolveCycles()
// This performs a depth-first search for a back-edge in all the
// (potentially disjoint) graphs formed by the resources referenced by
// |m_layoutObject|.
- ResourceSet::iterator end = localResources.end();
- for (ResourceSet::iterator it = localResources.begin(); it != end; ++it) {
- if (m_activeResources.contains(*it) || resourceContainsCycles(*it))
- breakCycle(*it);
+ for (auto* localResource : localResources) {
+ if (m_activeResources.contains(localResource) || resourceContainsCycles(localResource))
+ breakCycle(localResource);
}
m_activeResources.clear();
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceGradient.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698