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

Unified Diff: Source/core/dom/DocumentMarkerController.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: rebase Created 5 years, 11 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/clipboard/DataObject.cpp ('k') | Source/core/dom/ElementData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentMarkerController.cpp
diff --git a/Source/core/dom/DocumentMarkerController.cpp b/Source/core/dom/DocumentMarkerController.cpp
index 8211471e19280fa2f2830a44b8635520c9a8bfb0..abaf0752368168444a9113d16fbe4e4090520f15 100644
--- a/Source/core/dom/DocumentMarkerController.cpp
+++ b/Source/core/dom/DocumentMarkerController.cpp
@@ -444,10 +444,7 @@ DocumentMarkerVector DocumentMarkerController::markersInRange(Range* range, Docu
Node* pastLastNode = range->pastLastNode();
for (Node* node = range->firstNode(); node != pastLastNode; node = NodeTraversal::next(*node)) {
- DocumentMarkerVector markers = markersFor(node);
- DocumentMarkerVector::const_iterator end = markers.end();
- for (DocumentMarkerVector::const_iterator it = markers.begin(); it != end; ++it) {
- DocumentMarker* marker = *it;
+ for (DocumentMarker* marker : markersFor(node)) {
if (!markerTypes.contains(marker->type()))
continue;
if (node == startContainer && marker->endOffset() <= static_cast<unsigned>(range->startOffset()))
@@ -721,10 +718,7 @@ bool DocumentMarkerController::hasMarkers(Range* range, DocumentMarker::MarkerTy
Node* pastLastNode = range->pastLastNode();
for (Node* node = range->firstNode(); node != pastLastNode; node = NodeTraversal::next(*node)) {
- DocumentMarkerVector markers = markersFor(node);
- DocumentMarkerVector::const_iterator end = markers.end();
- for (DocumentMarkerVector::const_iterator it = markers.begin(); it != end; ++it) {
- DocumentMarker* marker = *it;
+ for (const DocumentMarker* marker : markersFor(node)) {
if (!markerTypes.contains(marker->type()))
continue;
if (node == startContainer && marker->endOffset() <= static_cast<unsigned>(range->startOffset()))
« no previous file with comments | « Source/core/clipboard/DataObject.cpp ('k') | Source/core/dom/ElementData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698