2 ms·
IEnumerable is fun. A while ago I wrote a lazy streaming no-accumulation Batch extension method using a bunch of features like yield return and manual enumerati
by infogulch 4y ago
IEnumerable is fun. A while ago I wrote a lazy streaming no-accumulation Batch extension method using a bunch of features like yield return and manual enumeration that happens to be one of my more upvoted answers.
public static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> source, int size)
https://stackoverflow.com/a/44505349/213246 https://stackoverflow.com/a/44505349/213246