https://github.com/HazardyKnusperkeks created https://github.com/llvm/llvm-project/pull/68154
When Shift is 0 there does nothing happen in the remainder of the loop, express that directly. From cd77a3cce4497c12c1d65d2f41d71b4ef3b5c079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= <bjo...@hazardy.de> Date: Tue, 3 Oct 2023 17:32:47 +0200 Subject: [PATCH] [clang-format][NFC] AlignTokenSequence: Skip loop iteration When Shift is 0 there does nothing happen in the remainder of the loop, express that directly. --- clang/lib/Format/WhitespaceManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index 2cbde3da212ec65..be8eb4f60f310c9 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -353,6 +353,9 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End, } } + if (Shift == 0) + continue; + // This is for function parameters that are split across multiple lines, // as mentioned in the ScopeStack comment. if (InsideNestedScope && Changes[i].NewlinesBefore > 0) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits