public Program() { const int count = 200000; _list = new List <int>(count); _list2 = new MyFastListEnumerable <int>(count); _list3 = new MyFastListEnumerator <int>(count); for (int i = 0; i < count; i++) { _list.Add(i + 1); _list2[i] = _list3[i] = i + 1; } }
public Program() { const int count = 200000; _array = new int[count]; _array2 = new MyFastListEnumerable <int>(count); _array3 = new MyFastListEnumerator <int>(count); for (int i = 0; i < count; i++) { var value = (i + 1) * ((i & 1) == 0 ? 1 : -1); // +1/-1 to avoid Sum overflow _array[i] = value; _array2[i] = _array3[i] = value; } }