[PATCH] D121069: [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 6 15:05:44 PST 2022


owenpan added inline comments.


================
Comment at: clang/lib/Format/WhitespaceManager.h:318
          Next = Next->NextColumnElement) {
+      if (RowCount > MaxRowCount) {
+        break;
----------------
owenpan wrote:
> curdeius wrote:
> > You can elide braces. Personally I use RemoveBraces locally.
> Why do we need this check? Is it because `CellStop` might not be null terminated? Or is it because `CellCount` may be zero? If the latter, we can check `CellCount` before the loop instead of this check in the loop.
Ok, you already explained why you added the check, but I still wonder what causes it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121069/new/

https://reviews.llvm.org/D121069



More information about the cfe-commits mailing list