Skip to content

Commit

Permalink
[clang-format][NFC] Don't add a load of 0es
Browse files Browse the repository at this point in the history
Shift is 0 for all non comments, maybe even for comments. Don't add the
0 up to three times.

Differential Revision: https://reviews.llvm.org/D138357
  • Loading branch information
HazardyKnusperkeks committed Nov 21, 2022
1 parent c89d2fd commit 9e00909
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Format/WhitespaceManager.cpp
Expand Up @@ -1049,7 +1049,7 @@ void WhitespaceManager::alignTrailingComments(unsigned Start, unsigned End,
Changes[i].StartOfBlockComment->StartOfTokenColumn -
Changes[i].StartOfTokenColumn;
}
if (Shift < 0)
if (Shift <= 0)
continue;
Changes[i].Spaces += Shift;
if (i + 1 != Changes.size())
Expand Down

0 comments on commit 9e00909

Please sign in to comment.