Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 25, 2024
1 parent e1f9182 commit addd902
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,6 @@ impl DepGraph {

let mapped = condensed.filter_map(
|_, node| {
if node.iter().all(|&ix| {
let id = &self.g.graph_ix[ix as usize];

data[id].pure
}) {
done.extend(node.iter().copied());
return None;
}

let mut item_ids = node
.iter()
.map(|&ix| {
Expand All @@ -616,7 +607,12 @@ impl DepGraph {

for node in self.g.graph_ix.iter() {
let ix = self.g.get_node(node);

if !done.contains(&ix) {
if data[node].pure {
continue;
}

let item_ids = vec![node.clone()];
new_graph.node(&item_ids);
}
Expand Down

0 comments on commit addd902

Please sign in to comment.