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

2021-12-04 Thread Björn Schäpers via Phabricator via cfe-commits
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 ) {
-  for (SmallVectorImpl::iterator I = Line.Children.begin(),
-  E = Line.Children.end();
-   I != E; ++I) {
-annotate(**I);
-  }
+  for (auto  : Line.Children)
+annotate(*Child);
+
   AnnotatingParser Parser(Style, Line, Keywords);
   Line.Type = Parser.parseLine();
 


Index: clang/lib/Format/TokenAnnotator.cpp
===
--- clang/lib/Format/TokenAnnotator.cpp
+++ clang/lib/Format/TokenAnnotator.cpp
@@ -2373,11 +2373,9 @@
 }
 
 void TokenAnnotator::annotate(AnnotatedLine ) {
-  for (SmallVectorImpl::iterator I = Line.Children.begin(),
-  E = Line.Children.end();
-   I != E; ++I) {
-annotate(**I);
-  }
+  for (auto  : Line.Children)
+annotate(*Child);
+
   AnnotatingParser Parser(Style, Line, Keywords);
   Line.Type = Parser.parseLine();
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2021-12-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.

LGTM.




Comment at: clang/lib/Format/TokenAnnotator.cpp:2376
 void TokenAnnotator::annotate(AnnotatedLine ) {
-  for (SmallVectorImpl::iterator I = Line.Children.begin(),
-  E = Line.Children.end();
-   I != E; ++I) {
-annotate(**I);
-  }
+  for (auto  : Line.Children)
+annotate(*Child);

Nit: I'd keep the type.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115067

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2021-12-03 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks created this revision.
HazardyKnusperkeks added reviewers: MyDeveloperDay, curdeius, owenpan.
HazardyKnusperkeks added a project: clang-format.
HazardyKnusperkeks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

That's much easier to read.


Repository:
  rG LLVM Github Monorepo

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 ) {
-  for (SmallVectorImpl::iterator I = Line.Children.begin(),
-  E = Line.Children.end();
-   I != E; ++I) {
-annotate(**I);
-  }
+  for (auto  : Line.Children)
+annotate(*Child);
+
   AnnotatingParser Parser(Style, Line, Keywords);
   Line.Type = Parser.parseLine();
 


Index: clang/lib/Format/TokenAnnotator.cpp
===
--- clang/lib/Format/TokenAnnotator.cpp
+++ clang/lib/Format/TokenAnnotator.cpp
@@ -2373,11 +2373,9 @@
 }
 
 void TokenAnnotator::annotate(AnnotatedLine ) {
-  for (SmallVectorImpl::iterator I = Line.Children.begin(),
-  E = Line.Children.end();
-   I != E; ++I) {
-annotate(**I);
-  }
+  for (auto  : Line.Children)
+annotate(*Child);
+
   AnnotatingParser Parser(Style, Line, Keywords);
   Line.Type = Parser.parseLine();
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits