[clang-format][NFC] TokenAnnotator: Use range based for
authorBjörn Schäpers <bjoern@hazardy.de>
Sun, 2 Jan 2022 21:12:46 +0000 (22:12 +0100)
committerBjörn Schäpers <bjoern@hazardy.de>
Wed, 5 Jan 2022 11:31:35 +0000 (12:31 +0100)
Differential Revision: https://reviews.llvm.org/D116560

clang/lib/Format/TokenAnnotator.cpp

index 3cd8912..b501c4d 100644 (file)
@@ -2550,11 +2550,8 @@ bool TokenAnnotator::mustBreakForReturnType(const AnnotatedLine &Line) const {
 }
 
 void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) {
-  for (SmallVectorImpl<AnnotatedLine *>::iterator I = Line.Children.begin(),
-                                                  E = Line.Children.end();
-       I != E; ++I) {
-    calculateFormattingInformation(**I);
-  }
+  for (AnnotatedLine *ChildLine : Line.Children)
+    calculateFormattingInformation(*ChildLine);
 
   Line.First->TotalLength =
       Line.First->IsMultiline ? Style.ColumnLimit