Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Remove needless Arc #75601

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions crates/napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ fn init() {
}

#[inline]
fn get_compiler() -> Arc<Compiler> {
fn get_compiler() -> Compiler {
let cm = Arc::new(SourceMap::new(FilePathMapping::empty()));

Arc::new(Compiler::new(cm))
Compiler::new(cm)
}

pub fn complete_output(
Expand Down Expand Up @@ -136,8 +136,6 @@ pub fn complete_output(
Ok(js_output)
}

pub type ArcCompiler = Arc<Compiler>;

static REGISTER_ONCE: Once = Once::new();

#[cfg(not(target_arch = "wasm32"))]
Expand Down
3 changes: 1 addition & 2 deletions crates/napi/src/minify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
use std::sync::Arc;

use napi::bindgen_prelude::*;
use rustc_hash::FxHashMap;
Expand All @@ -42,7 +41,7 @@ use swc_core::{
use crate::{get_compiler, util::MapErr};

pub struct MinifyTask {
c: Arc<swc_core::base::Compiler>,
c: swc_core::base::Compiler,
code: MinifyTarget,
opts: swc_core::base::config::JsMinifyOptions,
}
Expand Down
3 changes: 1 addition & 2 deletions crates/napi/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use std::{
fs::read_to_string,
panic::{catch_unwind, AssertUnwindSafe},
rc::Rc,
sync::Arc,
};

use anyhow::{anyhow, bail, Context as _};
Expand All @@ -58,7 +57,7 @@ pub enum Input {
}

pub struct TransformTask {
pub c: Arc<Compiler>,
pub c: Compiler,
pub input: Input,
pub options: Buffer,
}
Expand Down
Loading