Skip to content

Commit

Permalink
refactor(fe): simplify Lexer::transaction_has_lex_diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
strager committed Aug 20, 2024
1 parent d8b388d commit 0549e1c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/quick-lint-js/fe/lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,8 @@ void Lexer::roll_back_transaction(Lexer_Transaction&& transaction) {
this->transaction_allocator_.rewind(std::move(transaction.allocator_rewind));
}

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

void Lexer::insert_semicolon() {
Expand Down

0 comments on commit 0549e1c

Please sign in to comment.