Add bound check

This commit is contained in:
Edwin Cheng 2019-11-17 13:18:42 +08:00
parent d0357fc3b2
commit 977cf381ce

View File

@ -169,12 +169,12 @@ pub fn run(
println!(
"Expressions of unknown type: {} ({}%)",
num_exprs_unknown,
(num_exprs_unknown * 100 / num_exprs)
if num_exprs > 0 { (num_exprs_unknown * 100 / num_exprs) } else { 100 }
);
println!(
"Expressions of partially unknown type: {} ({}%)",
num_exprs_partially_unknown,
(num_exprs_partially_unknown * 100 / num_exprs)
if num_exprs > 0 { (num_exprs_partially_unknown * 100 / num_exprs) } else { 100 }
);
println!("Type mismatches: {}", num_type_mismatches);
println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage());