From a1606d106018003b0d26d0b2222960390b130cb8 Mon Sep 17 00:00:00 2001 From: magic-akari Date: Fri, 6 Sep 2024 11:46:39 +0800 Subject: [PATCH] fix: performance issue --- .../src/decorators/legacy/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs b/crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs index e2aaf3713901..80e54ea41398 100644 --- a/crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs +++ b/crates/swc_ecma_transforms_proposal/src/decorators/legacy/mod.rs @@ -182,7 +182,10 @@ impl TscDecorator { elems: decorators .into_iter() .inspect(|e| { - has_private_access |= Self::has_private_access(e); + if has_private_access { + return; + } + has_private_access = Self::has_private_access(e); }) .map(|mut v| { remove_span(&mut v);