mirror of
https://github.com/nachoparker/dutree
synced 2024-05-12 23:56:08 +02:00
Guard additional division
This commit is contained in:
parent
2712a7ffdf
commit
29158480e3
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue