Skip to content

Commit

Permalink
fix: panic of module_graph.get_depth (#6846)
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Jun 18, 2024
1 parent ede24bb commit 3e62ca4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/rspack_core/src/module_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,9 @@ impl<'a> ModuleGraph<'a> {
}

pub fn get_depth(&self, module_id: &ModuleIdentifier) -> Option<usize> {
let mgm = self
self
.module_graph_module_by_identifier(module_id)
.expect("should have module graph module");
mgm.depth
.and_then(|mgm| mgm.depth)
}

pub fn set_depth(&mut self, module_id: ModuleIdentifier, depth: usize) {
Expand Down

2 comments on commit 3e62ca4

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-06-18 553f785) Current Change
10000_development-mode + exec 2.21 s ± 22 ms 2.23 s ± 24 ms +0.61 %
10000_development-mode_hmr + exec 737 ms ± 12 ms 734 ms ± 8.9 ms -0.41 %
10000_production-mode + exec 2.57 s ± 22 ms 2.58 s ± 22 ms +0.67 %
arco-pro_development-mode + exec 1.94 s ± 68 ms 1.93 s ± 67 ms -0.64 %
arco-pro_development-mode_hmr + exec 441 ms ± 2.1 ms 443 ms ± 1.5 ms +0.40 %
arco-pro_production-mode + exec 3.53 s ± 85 ms 3.56 s ± 71 ms +1.01 %
threejs_development-mode_10x + exec 1.46 s ± 11 ms 1.47 s ± 16 ms +0.49 %
threejs_development-mode_10x_hmr + exec 799 ms ± 3.3 ms 791 ms ± 12 ms -0.94 %
threejs_production-mode_10x + exec 4.76 s ± 33 ms 4.78 s ± 32 ms +0.35 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
_selftest ✅ success
nx ✅ success
rspress ✅ success
rsbuild ✅ success
compat ✅ success
examples ✅ success

Please sign in to comment.