curdeius added inline comments.
================ Comment at: clang/lib/Format/BreakableToken.cpp:818 const auto FirstNonSpace = Lines[i][IndentPrefix.size()]; const auto AllowsSpaceChange = + (!LineTok || !switchesFormatting(*LineTok)) && ---------------- curdeius wrote: > HazardyKnusperkeks wrote: > > This slowly gets hard to read. Could you maybe split it up? Either in > > giving the multiple parts their own name. Or to keep the short circuiting > > have something like: > > ``` > > auto AllowsSpaceChange = ...; > > AllowsSpaceChange = AllowsSpaceChange || ...; > > AllowsSpaceChange = AllowsSpaceChange || ...; > > ``` > Or use a lambda (with a series of ifs for instance) to initialize it. While here, please change `auto` to `bool`. ================ Comment at: clang/lib/Format/BreakableToken.cpp:818-822 const auto AllowsSpaceChange = - SpacesInPrefix != 0 || - (!NoSpaceBeforeFirstCommentChar() || - (FirstNonSpace == '}' && FirstLineSpaceChange != 0)); + (!LineTok || !switchesFormatting(*LineTok)) && + (SpacesInPrefix != 0 || + (!NoSpaceBeforeFirstCommentChar() || + (FirstNonSpace == '}' && FirstLineSpaceChange != 0))); ---------------- HazardyKnusperkeks wrote: > This slowly gets hard to read. Could you maybe split it up? Either in giving > the multiple parts their own name. Or to keep the short circuiting have > something like: > ``` > auto AllowsSpaceChange = ...; > AllowsSpaceChange = AllowsSpaceChange || ...; > AllowsSpaceChange = AllowsSpaceChange || ...; > ``` Or use a lambda (with a series of ifs for instance) to initialize it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120188/new/ https://reviews.llvm.org/D120188 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits