[clang] d48d1f8 - [clang-format][NFC] Merge another two calls to isOneOf
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 3 14:07:30 PST 2022
Author: Björn Schäpers
Date: 2022-01-03T23:06:55+01:00
New Revision: d48d1f8ee84577a1ca38d4fe03956ee27884e399
URL: https://github.com/llvm/llvm-project/commit/d48d1f8ee84577a1ca38d4fe03956ee27884e399
DIFF: https://github.com/llvm/llvm-project/commit/d48d1f8ee84577a1ca38d4fe03956ee27884e399.diff
LOG: [clang-format][NFC] Merge another two calls to isOneOf
Differential Revision: https://reviews.llvm.org/D115069
Added:
Modified:
clang/lib/Format/ContinuationIndenter.cpp
Removed:
################################################################################
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);
}
More information about the cfe-commits
mailing list