Definition at line 5 of file EnumerableHelpers.cs.
6 {
8 {
10 {
15 }
16 }
17 else
18 {
19 using IEnumerator<T> enumerator =
source.GetEnumerator();
20 if (enumerator.MoveNext())
21 {
22 T[] array2 = new T[4]
23 {
24 enumerator.Current,
25 default(T),
26 default(T),
27 default(T)
28 };
29 int num = 1;
30 while (enumerator.MoveNext())
31 {
32 if (num == array2.Length)
33 {
34 int num2 = num << 1;
35 if ((uint)num2 >
Array.MaxLength)
36 {
37 num2 = ((Array.MaxLength <= num) ? (num + 1) :
Array.MaxLength);
38 }
39 Array.Resize(ref array2, num2);
40 }
41 array2[num++] = enumerator.Current;
42 }
44 return array2;
45 }
46 }
48 return Array.Empty<T>();
49 }
References System.array, System.collection, System.count, System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.length, System.Array.MaxLength, and System.source.