Skip to content

Commit d2af1ea

Browse files
committed
[clang-format][NFC] Minor improvement to parseLabel()
1 parent 43a38e2 commit d2af1ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/Format/UnwrappedLineParser.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -3201,10 +3201,11 @@ void UnwrappedLineParser::parseDoWhile() {
32013201
void UnwrappedLineParser::parseLabel(bool LeftAlignLabel) {
32023202
nextToken();
32033203
unsigned OldLineLevel = Line->Level;
3204-
if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))
3205-
--Line->Level;
3204+
32063205
if (LeftAlignLabel)
32073206
Line->Level = 0;
3207+
else if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))
3208+
--Line->Level;
32083209

32093210
if (!Style.IndentCaseBlocks && CommentsBeforeNextToken.empty() &&
32103211
FormatTok->is(tok::l_brace)) {

0 commit comments

Comments
 (0)