Commit d1accf2c authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

fixups

parent 07836384
......@@ -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> {
match self {
Effect::Call { func, args, .. } => {
......
......@@ -980,10 +980,12 @@ pub async fn analyse_ecmascript_module_internal(
}
}
}
let scale = 150f32 / (*histogram.iter().max().unwrap() as f32);
for (i, count) in histogram.into_iter().enumerate() {
let bar = "*".repeat((count as f32 * scale) as usize);
println!("{i:3}: {bar} ({count})");
if !histogram.is_empty() {
let scale = 150f32 / (*histogram.iter().max().unwrap() as f32);
for (i, count) in histogram.into_iter().enumerate() {
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