Skip to content

Commit a262eeb

Browse files
authored
perf(es/parser): Reduce comparison (#10941)
1 parent 4317988 commit a262eeb

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,7 @@ fn parse_export<'a, P: Parser<'a>>(
348348
p.assert_and_bump(&P::Token::EXPORT);
349349

350350
let cur = p.input().cur();
351-
if cur.is_error() {
352-
let err = p.input_mut().expect_error_token_and_bump();
353-
return Err(err);
354-
} else if cur.is_eof() {
351+
if cur.is_eof() {
355352
return Err(eof_error(p));
356353
}
357354

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,9 +1257,6 @@ fn parse_stmt_internal<'a, P: Parser<'a>>(
12571257
span: p.span(start),
12581258
}
12591259
.into());
1260-
} else if cur.is_error() {
1261-
let err = p.input_mut().expect_error_token_and_bump();
1262-
return Err(err);
12631260
}
12641261

12651262
// Handle async function foo() {}

0 commit comments

Comments
 (0)