Skip to content

Add BatchListIntoGroupsOf #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2018
Merged

Add BatchListIntoGroupsOf #20

merged 2 commits into from
Dec 19, 2018

Conversation

yorinasub17
Copy link
Contributor

This implements BatchListIntoGroupsOf, which will take a list of strings and batch them into groups of batchSize.

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

}

// Taken from SliceTricks: https://github.com/golang/go/wiki/SliceTricks#batching-with-minimal-allocation
// Intuition: We repeatedly slice off batchSize elements from slice and append it to the output, until there
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, I didn't realize they had a batch example right in there 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Saves me the trouble :)

@yorinasub17
Copy link
Contributor Author

Merging and releasing!

@yorinasub17 yorinasub17 merged commit 6a21631 into master Dec 19, 2018
@yorinasub17 yorinasub17 deleted the yori-groups-of branch December 19, 2018 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants