Commit d1accf2c authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

fixups

parent 07836384
...@@ -251,7 +251,7 @@ impl Effect { ...@@ -251,7 +251,7 @@ impl Effect {
} }
} }
/// Normalizes all contained values. /// Returns all JsValues referened by this effect. (Intended for debugging purposes.)
pub fn values(&self) -> Vec<&JsValue> { pub fn values(&self) -> Vec<&JsValue> {
match self { match self {
Effect::Call { func, args, .. } => { Effect::Call { func, args, .. } => {
......
...@@ -980,10 +980,12 @@ pub async fn analyse_ecmascript_module_internal( ...@@ -980,10 +980,12 @@ pub async fn analyse_ecmascript_module_internal(
} }
} }
} }
let scale = 150f32 / (*histogram.iter().max().unwrap() as f32); if !histogram.is_empty() {
for (i, count) in histogram.into_iter().enumerate() { let scale = 150f32 / (*histogram.iter().max().unwrap() as f32);
let bar = "*".repeat((count as f32 * scale) as usize); for (i, count) in histogram.into_iter().enumerate() {
println!("{i:3}: {bar} ({count})"); let bar = "*".repeat((count as f32 * scale) as usize);
println!("{i:3}: {bar} ({count})");
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment