Skip to content

Commit 1ad8506

Browse files
CPunisherkdy1
authored andcommitted
perf(es/lexer): Remove option for handler (#10881)
**Description:** There's already an `ERR` byte handler
1 parent 27e548d commit 1ad8506

File tree

2 files changed

+78
-91
lines changed

2 files changed

+78
-91
lines changed

crates/swc_ecma_parser/src/lexer/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,7 @@ impl<'a> Lexer<'a> {
156156
};
157157

158158
let handler = unsafe { *(&BYTE_HANDLERS as *const ByteHandler).offset(byte as isize) };
159-
160-
match handler {
161-
Some(handler) => handler(self),
162-
None => {
163-
let start = self.cur_pos();
164-
self.input.bump_bytes(1);
165-
self.error_span(
166-
pos_span(start),
167-
SyntaxError::UnexpectedChar { c: byte as _ },
168-
)
169-
}
170-
}
159+
handler(self)
171160
}
172161

173162
fn read_token_plus_minus<const C: u8>(&mut self) -> LexResult<Token> {

0 commit comments

Comments
 (0)