[PATCH] D12369: [clang-format] Fix alignConsecutiveAssignments not working properly

Beren Minor via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 09:23:33 PDT 2015


berenm added a comment.

I'm not entirely sure of what was going on, so I rewrote the code a bit, and hopefully, more clearly.


================
Comment at: lib/Format/WhitespaceManager.cpp:218
@@ -217,3 +229,1 @@
-  bool AlignedAssignment = false;
-  int PreviousShift = 0;
   for (unsigned i = Start; i != End; ++i) {
----------------
What was the purpose of `PreviousShift`?

================
Comment at: lib/Format/WhitespaceManager.cpp:229
@@ -228,3 +244,3 @@
     assert(Shift >= 0);
-    Changes[i].Spaces += Shift;
     if (i + 1 != Changes.size())
----------------
Why shifting by `Shift` //and then// also by `PreviousShift`?


http://reviews.llvm.org/D12369





More information about the cfe-commits mailing list