1
0
Fork 0
mirror of https://github.com/nachoparker/dutree synced 2024-05-12 23:56:08 +02:00

Guard additional division

This commit is contained in:
Isaac Parker 2019-11-09 19:55:07 -08:00
parent 2712a7ffdf
commit 29158480e3

View File

@ -443,8 +443,7 @@ fn fmt_bar( bytes : &Vec<u64>, max_bytes : u64, width : usize, ascii_flag : bool
if x > pos {
total = part;
part = bytesi.next().unwrap_or(&0);
bars = ( part * bars ) / total;
bars = match total { 0 => 0, _ => (part * bars) / total };
pos = width - bars;
chr += 1;
if chr == levels || chr >= block_char.len() {