Fixed iterProgress not stopping if yield returns false

This commit is contained in:
Philipp Wolfer 2025-05-23 09:59:34 +02:00
parent 5927f41a83
commit 15755458e9

View file

@ -267,7 +267,9 @@ func iterProgress[T any](
steps := max(len(items)/100, 1)
return func(yield func(int, T) bool) {
for i, item := range items {
yield(i, item)
if !yield(i, item) {
return
}
p.Elapsed++
if i%steps == 0 {
c <- *t