Skip to content

Commit 9703599

Browse files
bvanjoikdy1
authored andcommitted
perf(es/parser): Reduce comparison (#10911)
1 parent e852c3a commit 9703599

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

crates/swc_ecma_lexer/src/common/parser/expr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,8 +2301,6 @@ pub fn parse_primary_expr_rest<'a, P: Parser<'a>>(
23012301

23022302
if cur.is_class() {
23032303
return parse_class_expr(p, start, decorators.unwrap_or_default());
2304-
} else if cur.is_eof() {
2305-
return Err(eof_error(p));
23062304
}
23072305

23082306
let try_parse_arrow_expr = |p: &mut P, id: Ident, id_is_async| -> PResult<Box<Expr>> {

crates/swc_ecma_lexer/src/common/parser/stmt.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,6 @@ fn parse_stmt_internal<'a, P: Parser<'a>>(
12601260
} else if cur.is_error() {
12611261
let err = p.input_mut().expect_error_token_and_bump();
12621262
return Err(err);
1263-
} else if cur.is_eof() {
1264-
return Err(eof_error(p));
12651263
}
12661264

12671265
// Handle async function foo() {}

0 commit comments

Comments
 (0)