projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4483e9b
)
[clang-format][NFC] Use range based for
author
Björn Schäpers
<bjoern@hazardy.de>
Fri, 3 Dec 2021 07:47:38 +0000
(08:47 +0100)
committer
Bjö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
patch
|
blob
|
history
diff --git
a/clang/lib/Format/TokenAnnotator.cpp
b/clang/lib/Format/TokenAnnotator.cpp
index
cc6d066
..
6b7f135
100644
(file)
--- a/
clang/lib/Format/TokenAnnotator.cpp
+++ b/
clang/lib/Format/TokenAnnotator.cpp
@@
-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();