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

Unified Diff: Source/core/paint/GridPainter.cpp

Issue 796913002: Use C++11 range-based loop for core/clipboard, core/dom and core/testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove unused variable Created 6 years 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/paint/GridPainter.cpp
diff --git a/Source/core/paint/GridPainter.cpp b/Source/core/paint/GridPainter.cpp
index 0c0f880a171e4d9d90be89bd1142d0e141ed45c1..d9077dcc1825eff7b4420441ad4bc766867902ea 100644
--- a/Source/core/paint/GridPainter.cpp
+++ b/Source/core/paint/GridPainter.cpp
@@ -57,9 +57,9 @@ void GridPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& p
}
}
- for (Vector<RenderBox*>::const_iterator it = m_renderGrid.itemsOverflowingGridArea().begin(); it != m_renderGrid.itemsOverflowingGridArea().end(); ++it) {
- if ((*it)->frameRect().intersects(localPaintInvalidationRect))
- gridItemsToBePainted.append(std::make_pair(*it, m_renderGrid.paintIndexForGridItem(*it)));
+ for (const auto& it : m_renderGrid.itemsOverflowingGridArea()) {
+ if (it->frameRect().intersects(localPaintInvalidationRect))
+ gridItemsToBePainted.append(std::make_pair(it, m_renderGrid.paintIndexForGridItem(it)));
}
// Sort grid items following order-modified document order.
@@ -67,10 +67,10 @@ void GridPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& p
std::stable_sort(gridItemsToBePainted.begin(), gridItemsToBePainted.end(), GridItemsSorter());
RenderBox* previous = 0;
- for (Vector<std::pair<RenderBox*, size_t> >::const_iterator it = gridItemsToBePainted.begin(); it != gridItemsToBePainted.end(); ++it) {
+ for (const auto& it : gridItemsToBePainted) {
// We might have duplicates because of spanning children are included in all cells they span.
// Skip them here to avoid painting items several times.
- RenderBox* current = it->first;
+ RenderBox* current = it.first;
if (current == previous)
continue;

Powered by Google App Engine
This is Rietveld 408576698