HazardyKnusperkeks created this revision. HazardyKnusperkeks added reviewers: rymiel, owenpan, MyDeveloperDay. HazardyKnusperkeks added a project: clang-format. Herald added a project: All. HazardyKnusperkeks requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Shift is 0 for all non comments, maybe even for comments. Don't add the 0 up to three times. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D138357 Files: clang/lib/Format/WhitespaceManager.cpp Index: clang/lib/Format/WhitespaceManager.cpp =================================================================== --- clang/lib/Format/WhitespaceManager.cpp +++ clang/lib/Format/WhitespaceManager.cpp @@ -1049,7 +1049,7 @@ Changes[i].StartOfBlockComment->StartOfTokenColumn - Changes[i].StartOfTokenColumn; } - if (Shift < 0) + if (Shift <= 0) continue; Changes[i].Spaces += Shift; if (i + 1 != Changes.size())
Index: clang/lib/Format/WhitespaceManager.cpp =================================================================== --- clang/lib/Format/WhitespaceManager.cpp +++ clang/lib/Format/WhitespaceManager.cpp @@ -1049,7 +1049,7 @@ Changes[i].StartOfBlockComment->StartOfTokenColumn - Changes[i].StartOfTokenColumn; } - if (Shift < 0) + if (Shift <= 0) continue; Changes[i].Spaces += Shift; if (i + 1 != Changes.size())
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits