mirror of
https://github.com/swc-project/swc.git
synced 2024-10-05 04:39:06 +03:00
perf(es/helpers): Improve fast-path for helper detection (#6502)
This commit is contained in:
parent
75c4d22bb6
commit
b3b5526be4
@ -170,15 +170,12 @@ macro_rules! define_helpers {
|
||||
|
||||
impl InjectHelpers {
|
||||
fn is_helper_used(&self) -> bool{
|
||||
let mut value = false;
|
||||
|
||||
HELPERS.with(|helpers|{
|
||||
$(
|
||||
value |= helpers.inner.$name.load(Ordering::Relaxed);
|
||||
false $(
|
||||
|| helpers.inner.$name.load(Ordering::Relaxed)
|
||||
)*
|
||||
});
|
||||
|
||||
value
|
||||
})
|
||||
}
|
||||
|
||||
fn build_helpers(&self) -> Vec<Stmt> {
|
||||
|
Loading…
Reference in New Issue
Block a user