Skip to content

Commit 1b230f8

Browse files
committed
use simpler scaling
1 parent 1729669 commit 1b230f8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

bin/btrfs-blockgroup-report

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,9 @@ def report_usage(args):
129129
else:
130130
grouped_stats[group] = 1
131131

132-
min_count = min(count for _group, count in grouped_stats.items())
133132
max_count = max(count for _group, count in grouped_stats.items())
134133
for group, count in sorted(grouped_stats.items()):
135-
try:
136-
scaled_count = int(60 * (count - min_count) / (max_count - min_count))
137-
except ZeroDivisionError:
138-
scaled_count = 1
134+
scaled_count = int(60 * count / max_count)
139135
print(
140136
'\t' * 2,
141137
f' {str(group).rjust(3)}% packed',

0 commit comments

Comments
 (0)