-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slice: rework Batches and Chunks to return iterators (#21)
Instead of a slice of results, return a single-valued iterator over the selected components. A caller who wants the actual slices can use the slices.Collect helper: old := slice.Batches(vs, n) new := slices.Collect(slice.Batches(vs, n)) Existing use in the target of a range do not need to change, except for updating the target variables: for _, c := range slice.Chunks(vs, n) { becomes for c := range slice.Chunks(vs, n) {
- Loading branch information
1 parent
95316af
commit 5d31fc8
Showing
3 changed files
with
43 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters