From ef5418a917ffecdb6109e198f26bcd27c89c19a0 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 31 Jul 2024 03:32:54 +0000 Subject: [PATCH] refactor(parser): convert `Lexer::read_left_angle` to a single match (#4573) `Lexer::read_left_angle` was a series of disparate `next_ascii_byte_eq` and `peek_byte` calls. Convert it to a single match on `peek_byte`. This I think will remove a couple of bounds checks. --- crates/oxc_parser/src/lexer/punctuation.rs | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/crates/oxc_parser/src/lexer/punctuation.rs b/crates/oxc_parser/src/lexer/punctuation.rs index f49364c80..cc392e9a2 100644 --- a/crates/oxc_parser/src/lexer/punctuation.rs +++ b/crates/oxc_parser/src/lexer/punctuation.rs @@ -16,22 +16,23 @@ impl<'a> Lexer<'a> { /// returns None for `SingleLineHTMLOpenComment` `