perf(parser): remove an extra branch from parse_member_expression_rhs hot path (#896)

This commit is contained in:
Boshen 2023-09-11 23:25:19 +08:00 committed by GitHub
parent 38aa3205b4
commit 1793397f20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -540,7 +540,7 @@ impl<'a> Parser<'a> {
in_optional_chain: &mut bool,
) -> Result<Expression<'a>> {
let mut lhs = lhs;
while !self.at(Kind::Eof) {
loop {
lhs = match self.cur_kind() {
Kind::LBrack => self.parse_computed_member_expression(lhs_span, lhs, false)?,
Kind::Dot => self.parse_static_member_expression(lhs_span, lhs, false)?,