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: improve determine_export_assignments #6431

Merged
merged 6 commits into from
May 16, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Use usize::from
quininer committed May 10, 2024
commit 151a5a3f45d56cf2f7f798da7239e0b969256277
Original file line number Diff line number Diff line change
@@ -1358,7 +1358,7 @@ fn determine_export_assignments<'a>(
// js `Set` keep the insertion order, use `IndexSet` to align there behavior
let mut names: IndexSet<&Atom, BuildHasherDefault<FxHasher>> = IndexSet::default();
let mut dependency_indices =
Vec::with_capacity(dependencies.len() + additional_dependency.is_some() as usize);
Vec::with_capacity(dependencies.len() + usize::from(additional_dependency.is_some()));

for dependency in dependencies.iter().chain(additional_dependency.iter()) {
if let Some(module_identifier) = module_graph.module_identifier_by_dependency_id(dependency) {