Skip to content

Commit 630c736

Browse files
committed
[clang-format] Elide unnecessary braces. NFC.
1 parent b3af2ef commit 630c736

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

clang/lib/Format/ContinuationIndenter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,10 @@ RawStringFormatStyleManager::RawStringFormatStyleManager(
197197
LanguageStyle = PredefinedStyle;
198198
}
199199
LanguageStyle->ColumnLimit = CodeStyle.ColumnLimit;
200-
for (StringRef Delimiter : RawStringFormat.Delimiters) {
200+
for (StringRef Delimiter : RawStringFormat.Delimiters)
201201
DelimiterStyle.insert({Delimiter, *LanguageStyle});
202-
}
203-
for (StringRef EnclosingFunction : RawStringFormat.EnclosingFunctions) {
202+
for (StringRef EnclosingFunction : RawStringFormat.EnclosingFunctions)
204203
EnclosingFunctionStyle.insert({EnclosingFunction, *LanguageStyle});
205-
}
206204
}
207205
}
208206

clang/lib/Format/Format.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,9 +2092,8 @@ class Cleaner : public TokenAnalyzer {
20922092

20932093
private:
20942094
void cleanupLine(AnnotatedLine *Line) {
2095-
for (auto *Child : Line->Children) {
2095+
for (auto *Child : Line->Children)
20962096
cleanupLine(Child);
2097-
}
20982097

20992098
if (Line->Affected) {
21002099
cleanupRight(Line->First, tok::comma, tok::comma);
@@ -2120,9 +2119,8 @@ class Cleaner : public TokenAnalyzer {
21202119
std::set<unsigned> DeletedLines;
21212120
for (unsigned i = 0, e = AnnotatedLines.size(); i != e; ++i) {
21222121
auto &Line = *AnnotatedLines[i];
2123-
if (Line.startsWithNamespace()) {
2122+
if (Line.startsWithNamespace())
21242123
checkEmptyNamespace(AnnotatedLines, i, i, DeletedLines);
2125-
}
21262124
}
21272125

21282126
for (auto Line : DeletedLines) {
@@ -2184,9 +2182,8 @@ class Cleaner : public TokenAnalyzer {
21842182
AnnotatedLines[CurrentLine]->Last->Tok.getEndLoc())))
21852183
return false;
21862184

2187-
for (unsigned i = InitLine; i <= CurrentLine; ++i) {
2185+
for (unsigned i = InitLine; i <= CurrentLine; ++i)
21882186
DeletedLines.insert(i);
2189-
}
21902187

21912188
return true;
21922189
}

clang/lib/Format/MacroExpander.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ MacroExpander::MacroExpander(
125125
IdentifierTable &IdentTable)
126126
: SourceMgr(SourceMgr), Style(Style), Allocator(Allocator),
127127
IdentTable(IdentTable) {
128-
for (const std::string &Macro : Macros) {
128+
for (const std::string &Macro : Macros)
129129
parseDefinition(Macro);
130-
}
131130
}
132131

133132
MacroExpander::~MacroExpander() = default;

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,9 +1388,8 @@ class AnnotatingParser {
13881388
}
13891389

13901390
for (const auto &ctx : Contexts) {
1391-
if (ctx.InStructArrayInitializer) {
1391+
if (ctx.InStructArrayInitializer)
13921392
return LT_ArrayOfStructInitializer;
1393-
}
13941393
}
13951394

13961395
return LT_Other;

0 commit comments

Comments
 (0)