[clang-format][NFC] Merge another two calls to isOneOf
authorBjörn Schäpers <bjoern@hazardy.de>
Fri, 3 Dec 2021 15:37:02 +0000 (16:37 +0100)
committerBjörn Schäpers <bjoern@hazardy.de>
Mon, 3 Jan 2022 22:06:55 +0000 (23:06 +0100)
Differential Revision: https://reviews.llvm.org/D115069

clang/lib/Format/ContinuationIndenter.cpp

index 4225d6b..31f5de6 100644 (file)
@@ -1288,10 +1288,9 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
         State.Stack[i].NoLineBreak = true;
     State.Stack[State.Stack.size() - 2].NestedBlockInlined = false;
   }
-  if (Previous &&
-      (Previous->isOneOf(tok::l_paren, tok::comma, tok::colon) ||
-       Previous->isOneOf(TT_BinaryOperator, TT_ConditionalExpr)) &&
-      !Previous->isOneOf(TT_DictLiteral, TT_ObjCMethodExpr)) {
+  if (Previous && (Previous->isOneOf(TT_BinaryOperator, TT_ConditionalExpr) ||
+                   (Previous->isOneOf(tok::l_paren, tok::comma, tok::colon) &&
+                    !Previous->isOneOf(TT_DictLiteral, TT_ObjCMethodExpr)))) {
     State.Stack.back().NestedBlockInlined =
         !Newline && hasNestedBlockInlined(Previous, Current, Style);
   }