[clang-format] Remove unnecessary non-null check and assert instead. NFC.

After a non-eof token, there is at least an eof token.
This commit is contained in:
Marek Kurdej 2022-02-03 09:49:49 +01:00
parent 7a9e3ef77a
commit bb1b53da6e
1 changed files with 2 additions and 1 deletions

View File

@ -514,9 +514,10 @@ bool UnwrappedLineParser::parseLevel(bool HasOpeningBrace, IfStmtKind *IfKind) {
FormatToken *Next; FormatToken *Next;
do { do {
Next = Tokens->getNextToken(); Next = Tokens->getNextToken();
assert(Next);
} while (Next->is(tok::comment)); } while (Next->is(tok::comment));
FormatTok = Tokens->setPosition(StoredPosition); FormatTok = Tokens->setPosition(StoredPosition);
if (Next && Next->isNot(tok::colon)) { if (Next->isNot(tok::colon)) {
// default not followed by ':' is not a case label; treat it like // default not followed by ':' is not a case label; treat it like
// an identifier. // an identifier.
parseStructuralElement(); parseStructuralElement();