summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Schäpers <bjoern@hazardy.de>2021-12-03 16:37:02 +0100
committerBjörn Schäpers <bjoern@hazardy.de>2022-01-03 23:06:55 +0100
commitd48d1f8ee84577a1ca38d4fe03956ee27884e399 (patch)
treefd0e071005efad9031013ffbde4f0511d798fe42
parentf014ab933f35805159021d2d0c856a3c9af21a85 (diff)
downloadllvm-d48d1f8ee84577a1ca38d4fe03956ee27884e399.tar.gz
[clang-format][NFC] Merge another two calls to isOneOf
Differential Revision: https://reviews.llvm.org/D115069
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 4225d6b67b0e..31f5de673362 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -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);
}