mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-31 10:58:35 +02:00
Fix potential zero division error in iterProgress
This commit is contained in:
parent
a8ce2be5d7
commit
b7ce09041e
1 changed files with 1 additions and 1 deletions
|
@ -264,7 +264,7 @@ func iterProgress[T any](
|
|||
autocomplete bool,
|
||||
) iter.Seq2[int, T] {
|
||||
// Report progress in 1% steps
|
||||
steps := len(items) / 100
|
||||
steps := max(len(items)/100, 1)
|
||||
return func(yield func(int, T) bool) {
|
||||
for i, item := range items {
|
||||
yield(i, item)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue