[PATCH] D138357: [clang-format][NFC] Don't add a load of 0es

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 19 08:54:21 PST 2022


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())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138357.476687.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221119/2c21167a/attachment.bin>


More information about the cfe-commits mailing list