mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(transformer): HelperLoader common transform: remove Rcs (#6564)
State is uniquely owned by `HelperLoaderStore`, so no need for `Rc`.
This commit is contained in:
parent
1c1e9fc2c4
commit
50ecade892
1 changed files with 4 additions and 5 deletions
|
|
@ -62,7 +62,6 @@
|
|||
use std::{
|
||||
borrow::Cow,
|
||||
cell::{Cell, RefCell},
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
use oxc_allocator::Vec;
|
||||
|
|
@ -154,9 +153,9 @@ pub struct HelperLoaderStore<'a> {
|
|||
mode: HelperLoaderMode,
|
||||
module_name: Cow<'static, str>,
|
||||
/// Symbol ID for the `babelHelpers`.
|
||||
babel_helpers_symbol_id: Rc<Cell<Option<SymbolId>>>,
|
||||
babel_helpers_symbol_id: Cell<Option<SymbolId>>,
|
||||
/// Loaded helpers, determined what helpers are loaded and what imports should be added.
|
||||
loaded_helpers: Rc<RefCell<LoadedHelper<'a>>>,
|
||||
loaded_helpers: RefCell<LoadedHelper<'a>>,
|
||||
}
|
||||
|
||||
// Public methods
|
||||
|
|
@ -165,8 +164,8 @@ impl<'a> HelperLoaderStore<'a> {
|
|||
Self {
|
||||
mode: options.mode,
|
||||
module_name: options.module_name.clone(),
|
||||
loaded_helpers: Rc::new(RefCell::new(FxHashMap::default())),
|
||||
babel_helpers_symbol_id: Rc::new(Cell::new(None)),
|
||||
loaded_helpers: RefCell::new(FxHashMap::default()),
|
||||
babel_helpers_symbol_id: Cell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue