Skip to content

Commit 0549e1c

Browse files
committed
refactor(fe): simplify Lexer::transaction_has_lex_diagnostics
1 parent d8b388d commit 0549e1c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/quick-lint-js/fe/lex.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,8 @@ void Lexer::roll_back_transaction(Lexer_Transaction&& transaction) {
12711271
this->transaction_allocator_.rewind(std::move(transaction.allocator_rewind));
12721272
}
12731273

1274-
bool Lexer::transaction_has_lex_diagnostics(const Lexer_Transaction&) const {
1275-
Buffering_Diag_Reporter* buffered_diagnostics =
1276-
derived_cast<Buffering_Diag_Reporter*>(this->diag_reporter_);
1277-
return !buffered_diagnostics->empty();
1274+
bool Lexer::transaction_has_lex_diagnostics(const Lexer_Transaction& transaction) const {
1275+
return !transaction.reporter->diags().empty();
12781276
}
12791277

12801278
void Lexer::insert_semicolon() {

0 commit comments

Comments
 (0)