Skip to content

Commit 44ce0f0

Browse files
committed
Change Tok.isNot(a) && Tok.isNot(b) pattern to Tok.isNot(a, b)
1 parent 83492d8 commit 44ce0f0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ bool Parser::parseDifferentiableAttributeArguments(
10461046
linear = true;
10471047
consumeToken(tok::identifier);
10481048
// If no trailing comma or 'where' clause, terminate parsing arguments.
1049-
if (Tok.isNot(tok::comma) && Tok.isNot(tok::kw_where))
1049+
if (Tok.isNot(tok::comma, tok::kw_where))
10501050
return false;
10511051
if (consumeIfTrailingComma())
10521052
return errorAndSkipToEnd();
@@ -1089,7 +1089,7 @@ bool Parser::parseDifferentiableAttributeArguments(
10891089
funcDiag, /*allowOperators=*/true,
10901090
/*allowZeroArgCompoundNames=*/true);
10911091
// If no trailing comma or 'where' clause, terminate parsing arguments.
1092-
if (Tok.isNot(tok::comma) && Tok.isNot(tok::kw_where))
1092+
if (Tok.isNot(tok::comma, tok::kw_where))
10931093
terminateParsingArgs = true;
10941094
return !result.Name;
10951095
};
@@ -1126,8 +1126,7 @@ bool Parser::parseDifferentiableAttributeArguments(
11261126
}
11271127

11281128
// If parser has not advanced and token is not 'where' or ')', emit error.
1129-
if (Tok.getLoc() == startingLoc &&
1130-
Tok.isNot(tok::kw_where) && Tok.isNot(tok::r_paren)) {
1129+
if (Tok.getLoc() == startingLoc && Tok.isNot(tok::kw_where, tok::r_paren)) {
11311130
diagnose(Tok, diag::attr_differentiable_expected_label);
11321131
return errorAndSkipToEnd();
11331132
}

0 commit comments

Comments
 (0)