* Remove `RangeIterator.ToArray` bounds check
https://github.com/dotnet/runtime/pull/80633#discussion_r1082720454
* Eliminate additional `ToArray` bounds checks
TElement[] array = new TElement[count];
int[] map = SortedMap(buffer);
- for (int i = 0; i != array.Length; i++)
+ for (int i = 0; i < array.Length; i++)
{
array[i] = buffer._items[map[i]];
}
}
TSource[] array = new TSource[count];
- for (int i = 0, curIdx = _minIndexInclusive; i != array.Length; ++i, ++curIdx)
+ for (int i = 0, curIdx = _minIndexInclusive; i < array.Length; ++i, ++curIdx)
{
array[i] = _source[curIdx];
}
{
int[] array = new int[_end - _start];
int cur = _start;
- for (int i = 0; i != array.Length; ++i)
+ for (int i = 0; i < array.Length; ++i)
{
array[i] = cur;
++cur;
}
TResult[] array = new TResult[count];
- for (int i = 0, curIdx = _minIndexInclusive; i != array.Length; ++i, ++curIdx)
+ for (int i = 0, curIdx = _minIndexInclusive; i < array.Length; ++i, ++curIdx)
{
array[i] = _selector(_source[curIdx]);
}