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

hstr #16

Closed
wants to merge 6 commits into from
Closed

hstr #16

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
7 changes: 7 additions & 0 deletions .changeset/dull-carrots-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
swc: patch
swc_core: patch
swc_ecma_transforms_base: patch
---

perf(es): Avoid needless string comparisons
1 change: 0 additions & 1 deletion crates/swc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ impl<'a, 'b, P: swc_ecma_visit::Fold> PassBuilder<'a, 'b, P> {
modules::import_analysis::import_analyzer(import_interop, ignore_dynamic),
need_analyzer
),
compat::reserved_words::reserved_words(),
Optional::new(
helpers::inject_helpers(self.unresolved_mark),
self.inject_helpers
Expand Down
6 changes: 3 additions & 3 deletions crates/swc_ecma_transforms_base/src/rename/analyzer/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
#[cfg(feature = "concurrent-renamer")]
use rayon::prelude::*;
use rustc_hash::FxHashSet;
use swc_atoms::Atom;
use swc_atoms::{atom, Atom};
use swc_common::{collections::AHashMap, util::take::Take, Mark, SyntaxContext};
use swc_ecma_ast::*;
use tracing::debug;
Expand Down Expand Up @@ -51,7 +51,7 @@ pub(super) struct ScopeData {

impl Scope {
pub(super) fn add_decl(&mut self, id: &Id, has_eval: bool, top_level_mark: Mark) {
if id.0 == "arguments" {
if id.0 == atom!("arguments") {
return;
}

Expand All @@ -73,7 +73,7 @@ impl Scope {
}

pub(super) fn add_usage(&mut self, id: Id) {
if id.0 == "arguments" {
if id.0 == atom!("arguments") {
return;
}

Expand Down
Loading