1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-14 03:55:42 +00:00
Oliver Booth 2021-03-09 16:59:50 +00:00
parent 95fda962ed
commit c584b9c331

View File

@ -36,7 +36,7 @@ namespace X10D.EnumerableExtensions
public static IEnumerable<IEnumerable<T>> Split<T>(this IEnumerable<T> value, int chunkSize) public static IEnumerable<IEnumerable<T>> Split<T>(this IEnumerable<T> value, int chunkSize)
{ {
var enumerable = value.ToArray(); var enumerable = value.ToArray();
var count = enumerable.LongCount(); var count = enumerable.LongLength;
chunkSize = chunkSize.Clamp(1, enumerable.Length); chunkSize = chunkSize.Clamp(1, enumerable.Length);
for (var i = 0; i < (int)(count / chunkSize); i++) for (var i = 0; i < (int)(count / chunkSize); i++)