Skip to content

Commit bb1b53d

Browse files
committed
[clang-format] Remove unnecessary non-null check and assert instead. NFC.
After a non-eof token, there is at least an eof token.
1 parent 7a9e3ef commit bb1b53d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,10 @@ bool UnwrappedLineParser::parseLevel(bool HasOpeningBrace, IfStmtKind *IfKind) {
514514
FormatToken *Next;
515515
do {
516516
Next = Tokens->getNextToken();
517+
assert(Next);
517518
} while (Next->is(tok::comment));
518519
FormatTok = Tokens->setPosition(StoredPosition);
519-
if (Next && Next->isNot(tok::colon)) {
520+
if (Next->isNot(tok::colon)) {
520521
// default not followed by ':' is not a case label; treat it like
521522
// an identifier.
522523
parseStructuralElement();

0 commit comments

Comments
 (0)