[PATCH] D115067: [clang-format][NFC] Use range based for

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 4 12:30:40 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc25536e4feed: [clang-format][NFC] Use range based for (authored by HazardyKnusperkeks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115067/new/

https://reviews.llvm.org/D115067

Files:
  clang/lib/Format/TokenAnnotator.cpp


Index: clang/lib/Format/TokenAnnotator.cpp
===================================================================
--- clang/lib/Format/TokenAnnotator.cpp
+++ clang/lib/Format/TokenAnnotator.cpp
@@ -2373,11 +2373,9 @@
 }
 
 void TokenAnnotator::annotate(AnnotatedLine &Line) {
-  for (SmallVectorImpl<AnnotatedLine *>::iterator I = Line.Children.begin(),
-                                                  E = Line.Children.end();
-       I != E; ++I) {
-    annotate(**I);
-  }
+  for (auto &Child : Line.Children)
+    annotate(*Child);
+
   AnnotatingParser Parser(Style, Line, Keywords);
   Line.Type = Parser.parseLine();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115067.391863.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211204/93b36bfd/attachment.bin>


More information about the cfe-commits mailing list