Skip to content

Commit adfc7e7

Browse files
committed
Better edge case check
1 parent 6d8f22f commit adfc7e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func calcTimePerItemEstimate(tpie time.Duration, blockStartTime time.Time, alpha
514514
}
515515

516516
func percentage(total, current int64, ratio int) int {
517-
if current > total || (total == 0 && current == 0) {
517+
if total == 0 || current > total {
518518
return 0
519519
}
520520
num := float64(ratio) * float64(current) / float64(total)

0 commit comments

Comments
 (0)