[clang] [clang-format][NFC] Introduce isNotOneOf (PR #161021)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 03:22:57 PDT 2025


=?utf-8?q?Björn_Schäpers?= <bjoern at hazardy.de>,
=?utf-8?q?Björn_Schäpers?= <bjoern at hazardy.de>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/161021 at github.com>


================
@@ -686,8 +686,8 @@ class LineJoiner {
     }
     Limit = limitConsideringMacros(I + 1, E, Limit);
     AnnotatedLine &Line = **I;
-    if (Line.First->isNot(tok::kw_do) && Line.First->isNot(tok::kw_else) &&
-        Line.Last->isNot(tok::kw_else) && Line.Last->isNot(tok::r_paren)) {
+    if (Line.First->isNotOneOf(tok::kw_do, tok::kw_else) &&
----------------
mydeveloperday wrote:

I'm wondering if we should have  Line.beginsWith(),  Line.beingWithOneOf() and Line.doesNotBeingWithOneOf() I get a bit blind after a while in this code...

https://github.com/llvm/llvm-project/pull/161021


More information about the cfe-commits mailing list