Skip to content

Commit 91b9a66

Browse files
[clang-format][NFC] Reduce indent
By using if init statement.
1 parent 5cfa03e commit 91b9a66

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,18 +2093,16 @@ class AnnotatingParser {
20932093
!Current.Next->isOneOf(tok::semi, tok::colon, tok::l_brace,
20942094
tok::comma, tok::period, tok::arrow,
20952095
tok::coloncolon, tok::kw_noexcept)) {
2096-
if (FormatToken *AfterParen = Current.MatchingParen->Next) {
2097-
// Make sure this isn't the return type of an Obj-C block declaration
2098-
if (AfterParen->isNot(tok::caret)) {
2099-
if (FormatToken *BeforeParen = Current.MatchingParen->Previous) {
2100-
if (BeforeParen->is(tok::identifier) &&
2101-
BeforeParen->isNot(TT_TypenameMacro) &&
2102-
BeforeParen->TokenText == BeforeParen->TokenText.upper() &&
2103-
(!BeforeParen->Previous ||
2104-
BeforeParen->Previous->ClosesTemplateDeclaration)) {
2105-
Current.setType(TT_FunctionAnnotationRParen);
2106-
}
2107-
}
2096+
if (FormatToken *AfterParen = Current.MatchingParen->Next;
2097+
AfterParen && AfterParen->isNot(tok::caret)) {
2098+
// Make sure this isn't the return type of an Obj-C block declaration.
2099+
if (FormatToken *BeforeParen = Current.MatchingParen->Previous;
2100+
BeforeParen && BeforeParen->is(tok::identifier) &&
2101+
BeforeParen->isNot(TT_TypenameMacro) &&
2102+
BeforeParen->TokenText == BeforeParen->TokenText.upper() &&
2103+
(!BeforeParen->Previous ||
2104+
BeforeParen->Previous->ClosesTemplateDeclaration)) {
2105+
Current.setType(TT_FunctionAnnotationRParen);
21082106
}
21092107
}
21102108
}

0 commit comments

Comments
 (0)