Skip to content

Commit

Permalink
[clang-format][NFC] Minor improvement to parseLabel()
Browse files Browse the repository at this point in the history
  • Loading branch information
owenca committed May 3, 2024
1 parent 43a38e2 commit d2af1ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clang/lib/Format/UnwrappedLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3201,10 +3201,11 @@ void UnwrappedLineParser::parseDoWhile() {
void UnwrappedLineParser::parseLabel(bool LeftAlignLabel) {
nextToken();
unsigned OldLineLevel = Line->Level;
if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))
--Line->Level;

if (LeftAlignLabel)
Line->Level = 0;
else if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0))
--Line->Level;

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

0 comments on commit d2af1ea

Please sign in to comment.