Revert "Swap to using iterators for uploading to avoid storing all chunks in memory"

This reverts commit 632ecc5c81.
This commit is contained in:
David Dworken
2024-02-04 22:19:11 -08:00
parent ed583c36a3
commit 7c07236dc0
4 changed files with 40 additions and 66 deletions

View File

@ -122,20 +122,3 @@ func Chunks[k any](slice []k, chunkSize int) [][]k {
}
return chunks
}
type Seq1[K any] func(yield func(K) bool) bool
func ChunksIter[k any](slice []k, chunkSize int) Seq1[[]k] {
return func(yield func([]k) bool) bool {
for i := 0; i < len(slice); i += chunkSize {
end := i + chunkSize
if end > len(slice) {
end = len(slice)
}
if !yield(slice[i:end]) {
return false
}
}
return true
}
}