From 0101c8c38c11ca8fe90ccb36ee66a18160815c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 15 Nov 2024 09:28:49 +0900 Subject: [PATCH] Rename vars --- .../turbopack-ecmascript/src/tree_shake/graph.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs index c4c5a124a0562..75c521f2a9de9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs @@ -1476,22 +1476,22 @@ impl DepGraph { continue; } - let dependants = g + let sources = g .edges_directed(declarator, Direction::Incoming) .map(|e| (e.source(), *e.weight())) .collect::>(); // We depend on the export node to preserve the export - queue.push((node, declarator, dependants)); + queue.push((node, declarator, sources)); } } - for (node, declarator, dependants) in queue { + for (export_node, declarator, sources) in queue { // Move all edges from node to dependant - for (dependant, weight) in dependants { - g.add_edge(dependant, node, weight); + for (source, weight) in sources { + g.add_edge(source, export_node, weight); - if let Some(edge) = g.edges_connecting(dependant, declarator).next() { + if let Some(edge) = g.edges_connecting(source, declarator).next() { g.remove_edge(edge.id()); } }