perf(parser): use FxHashSet for not_parenthesized_arrow (#3344)

This commit is contained in:
Boshen 2024-05-19 01:13:56 +08:00 committed by GitHub
parent 899a52bf28
commit 46cb5f97a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
use std::collections::HashSet;
use rustc_hash::FxHashSet;
use oxc_allocator::{Allocator, Vec};
use oxc_ast::ast::Decorator;
@ -6,7 +6,7 @@ use oxc_ast::ast::Decorator;
pub struct ParserState<'a> {
allocator: &'a Allocator,
pub not_parenthesized_arrow: HashSet<u32>,
pub not_parenthesized_arrow: FxHashSet<u32>,
pub decorators: Vec<'a, Decorator<'a>>,
}
@ -15,7 +15,7 @@ impl<'a> ParserState<'a> {
pub fn new(allocator: &'a Allocator) -> Self {
Self {
allocator,
not_parenthesized_arrow: HashSet::new(),
not_parenthesized_arrow: FxHashSet::default(),
decorators: Vec::new_in(allocator),
}
}