[clang-format][NFC] Use range based for
authorBjörn Schäpers <bjoern@hazardy.de>
Fri, 3 Dec 2021 07:47:38 +0000 (08:47 +0100)
committerBjörn Schäpers <bjoern@hazardy.de>
Sat, 4 Dec 2021 20:29:30 +0000 (21:29 +0100)
That's much easier to read.

Differential Revision: https://reviews.llvm.org/D115067

clang/lib/Format/TokenAnnotator.cpp

index cc6d066..6b7f135 100644 (file)
@@ -2373,11 +2373,9 @@ static unsigned maxNestingDepth(const AnnotatedLine &Line) {
 }
 
 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();