31 types derived from Iterator
System.Linq (31)
System\Linq\AppendPrepend.cs (1)
39private abstract partial class AppendPrependIterator<TSource> : Iterator<TSource>
System\Linq\Concat.cs (1)
200private abstract partial class ConcatIterator<TSource> : Iterator<TSource>
System\Linq\DefaultIfEmpty.cs (1)
29private sealed partial class DefaultIfEmptyIterator<TSource> : Iterator<TSource>
System\Linq\Distinct.cs (1)
95private sealed partial class DistinctIterator<TSource> : Iterator<TSource>
System\Linq\Grouping.cs (4)
124private sealed partial class GroupByResultIterator<TSource, TKey, TElement, TResult> : Iterator<TResult> 182private sealed partial class GroupByResultIterator<TSource, TKey, TResult> : Iterator<TResult> 238private sealed partial class GroupByIterator<TSource, TKey, TElement> : Iterator<IGrouping<TKey, TElement>> 293private sealed partial class GroupByIterator<TSource, TKey> : Iterator<IGrouping<TKey, TSource>>
System\Linq\OrderedEnumerable.cs (1)
12private abstract partial class OrderedIterator<TElement> : Iterator<TElement>, IOrderedEnumerable<TElement>
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
442private sealed class SkipTakeOrderedIterator<TElement> : Iterator<TElement>
System\Linq\Range.cs (1)
34private sealed partial class RangeIterator : Iterator<int>
System\Linq\Repeat.cs (1)
31private sealed partial class RepeatIterator<TResult> : Iterator<TResult>
System\Linq\Reverse.cs (1)
45private sealed partial class ReverseIterator<TSource> : Iterator<TSource>
System\Linq\Select.cs (4)
93private sealed partial class IEnumerableSelectIterator<TSource, TResult> : Iterator<TResult> 154private sealed partial class ArraySelectIterator<TSource, TResult> : Iterator<TResult> 197private sealed partial class ListSelectIterator<TSource, TResult> : Iterator<TResult> 247private sealed partial class IListSelectIterator<TSource, TResult> : Iterator<TResult>
System\Linq\Select.SpeedOpt.cs (3)
236private sealed partial class RangeSelectIterator<TResult> : Iterator<TResult> 573private sealed class IteratorSelectIterator<TSource, TResult> : Iterator<TResult> 785private sealed class IListSkipTakeSelectIterator<TSource, TResult> : Iterator<TResult>
System\Linq\SelectMany.cs (1)
146private sealed partial class SelectManySingleSelectorIterator<TSource, TResult> : Iterator<TResult>
System\Linq\SkipTake.SpeedOpt.cs (2)
16private sealed class IListSkipTakeIterator<TSource> : Iterator<TSource>, IList<TSource>, IReadOnlyList<TSource> 202private sealed class IEnumerableSkipTakeIterator<TSource> : Iterator<TSource>
System\Linq\Union.cs (1)
101private abstract partial class UnionIterator<TSource> : Iterator<TSource>
System\Linq\Where.cs (6)
88private sealed partial class IEnumerableWhereIterator<TSource> : Iterator<TSource> 153private sealed partial class ArrayWhereIterator<TSource> : Iterator<TSource> 200private sealed partial class ListWhereIterator<TSource> : Iterator<TSource> 255private sealed partial class ArrayWhereSelectIterator<TSource, TResult> : Iterator<TResult> 303private sealed partial class ListWhereSelectIterator<TSource, TResult> : Iterator<TResult> 358private sealed partial class IEnumerableWhereSelectIterator<TSource, TResult> : Iterator<TResult>
System\Linq\Where.SpeedOpt.cs (1)
284private sealed partial class ListWhereIterator<TSource> : Iterator<TSource>
102 references to Iterator
System.Linq (102)
System\Linq\AnyAll.cs (1)
24if (source is Iterator<TSource> iterator)
System\Linq\AppendPrepend.cs (2)
101private protected override Iterator<TSource> Clone() => new AppendPrepend1Iterator<TSource>(_source, _item, _appending); 191private protected override Iterator<TSource> Clone() => new AppendPrependN<TSource>(_source, _prepended, _appended, _prependCount, _appendCount);
System\Linq\AppendPrepend.SpeedOpt.cs (2)
124if (_source is Iterator<TSource> iterator) 273if (_source is Iterator<TSource> iterator)
System\Linq\Cast.cs (2)
45private sealed partial class CastICollectionIterator<TResult>(ICollection source) : Iterator<TResult> 50private protected override Iterator<TResult> Clone() => new CastICollectionIterator<TResult>(_source);
System\Linq\Concat.cs (2)
68private protected override Iterator<TSource> Clone() => new Concat2Iterator<TSource>(_first, _second); 154private protected override Iterator<TSource> Clone() => new ConcatNIterator<TSource>(_tail, _head, _headIndex, _hasOnlyCollections);
System\Linq\Count.cs (2)
24if (source is Iterator<TSource> iterator) 121if (source is Iterator<TSource> iterator)
System\Linq\DefaultIfEmpty.cs (1)
42private protected override Iterator<TSource> Clone() => new DefaultIfEmptyIterator<TSource>(_source, _default);
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
39count = _source is Iterator<TSource> iterator ? iterator.GetCount(onlyIfCheap: true) : -1;
System\Linq\Distinct.cs (1)
109private protected override Iterator<TSource> Clone() => new DistinctIterator<TSource>(_source, _comparer);
System\Linq\ElementAt.cs (2)
27source is Iterator<TSource> iterator ? iterator.TryGetElementAt(index, out found) : 127source is Iterator<TSource> iterator ? iterator.TryGetElementAt(index, out found) :
System\Linq\First.cs (1)
74source is Iterator<TSource> iterator ? iterator.TryGetFirst(out found) :
System\Linq\Grouping.cs (4)
144private protected override Iterator<TResult> Clone() => new GroupByResultIterator<TSource, TKey, TElement, TResult>(_source, _keySelector, _elementSelector, _resultSelector, _comparer); 200private protected override Iterator<TResult> Clone() => new GroupByResultIterator<TSource, TKey, TResult>(_source, _keySelector, _resultSelector, _comparer); 256private protected override Iterator<IGrouping<TKey, TElement>> Clone() => new GroupByIterator<TSource, TKey, TElement>(_source, _keySelector, _elementSelector, _comparer); 309private protected override Iterator<IGrouping<TKey, TSource>> Clone() => new GroupByIterator<TSource, TKey>(_source, _keySelector, _comparer);
System\Linq\Iterator.cs (3)
49private protected abstract Iterator<TSource> Clone(); 72public Iterator<TSource> GetEnumerator() 74Iterator<TSource> enumerator = _state == 0 && _threadId == Environment.CurrentManagedThreadId ? this : Clone();
System\Linq\Iterator.SpeedOpt.cs (4)
36/// <returns>An <see cref="Iterator{TSource}"/> with the first <paramref name="count"/> items removed, or null if known empty.</returns> 37public virtual Iterator<TSource>? Skip(int count) => new IEnumerableSkipTakeIterator<TSource>(this, count, -1); 43/// <returns>An <see cref="Iterator{TSource}"/> with only the first <paramref name="count"/> items, or null if known empty.</returns> 44public virtual Iterator<TSource>? Take(int count) => new IEnumerableSkipTakeIterator<TSource>(this, 0, count - 1);
System\Linq\Last.cs (1)
73source is Iterator<TSource> iterator ? iterator.TryGetLast(out found) :
System\Linq\OfType.cs (2)
30private sealed partial class OfTypeIterator<TResult>(IEnumerable source) : Iterator<TResult> 35private protected override Iterator<TResult> Clone() => new OfTypeIterator<TResult>(_source);
System\Linq\OrderedEnumerable.cs (2)
93private protected override Iterator<TElement> Clone() => new OrderedIterator<TElement, TKey>(_source, _keySelector, _comparer, _descending, _parent); 185private protected override Iterator<TElement> Clone() => new ImplicitlyStableOrderedIterator<TElement>(_source, _descending);
System\Linq\OrderedEnumerable.SpeedOpt.cs (6)
56if (_source is Iterator<TElement> iterator) 140public override Iterator<TElement> Skip(int count) => new SkipTakeOrderedIterator<TElement>(this, count, int.MaxValue); 142public override Iterator<TElement> Take(int count) => new SkipTakeOrderedIterator<TElement>(this, 0, count - 1); 459private protected override Iterator<TElement> Clone() => new SkipTakeOrderedIterator<TElement>(_source, _minIndexInclusive, _maxIndexInclusive); 510public override Iterator<TElement>? Skip(int count) 516public override Iterator<TElement> Take(int count)
System\Linq\Range.cs (1)
48private protected override Iterator<int> Clone() => new RangeIterator(_start, _end - _start);
System\Linq\Range.SpeedOpt.cs (2)
40public override Iterator<int>? Skip(int count) 50public override Iterator<int> Take(int count)
System\Linq\Repeat.cs (1)
42private protected override Iterator<TResult> Clone()
System\Linq\Repeat.SpeedOpt.cs (2)
36public override Iterator<TResult>? Skip(int count) 48public override Iterator<TResult> Take(int count)
System\Linq\Reverse.cs (1)
56private protected override Iterator<TSource> Clone() => new ReverseIterator<TSource>(_source);
System\Linq\Reverse.SpeedOpt.cs (2)
58if (_source is Iterator<TSource> iterator) 94if (_source is Iterator<TSource> iterator)
System\Linq\Select.cs (5)
26if (source is Iterator<TSource> iterator) 107private protected override Iterator<TResult> Clone() => 170private protected override Iterator<TResult> Clone() => new ArraySelectIterator<TSource, TResult>(_source, _selector); 213private protected override Iterator<TResult> Clone() => new ListSelectIterator<TSource, TResult>(_source, _selector); 263private protected override Iterator<TResult> Clone() => new IListSelectIterator<TSource, TResult>(_source, _selector);
System\Linq\Select.SpeedOpt.cs (22)
187public override Iterator<TResult>? Skip(int count) 198public override Iterator<TResult> Take(int count) 253private protected override Iterator<TResult> Clone() => 312public override Iterator<TResult>? Skip(int count) 324public override Iterator<TResult> Take(int count) 415public override Iterator<TResult> Skip(int count) 421public override Iterator<TResult> Take(int count) 518public override Iterator<TResult> Skip(int count) 524public override Iterator<TResult> Take(int count) 569/// An iterator that maps each item of an <see cref="Iterator{TSource}"/>. 575private readonly Iterator<TSource> _source; 577private Iterator<TSource>? _enumerator; 579public IteratorSelectIterator(Iterator<TSource> source, Func<TSource, TResult> selector) 587private protected override Iterator<TResult> Clone() => 627public override Iterator<TResult>? Skip(int count) 630Iterator<TSource>? source = _source.Skip(count); 634public override Iterator<TResult>? Take(int count) 637Iterator<TSource>? source = _source.Take(count); 745private static void Fill(Iterator<TSource> source, Span<TResult> results, Func<TSource, TResult> func) 804private protected override Iterator<TResult> Clone() => 827public override Iterator<TResult>? Skip(int count) 834public override Iterator<TResult> Take(int count)
System\Linq\SelectMany.cs (1)
162private protected override Iterator<TResult> Clone()
System\Linq\Skip.cs (2)
26if (source is Iterator<TSource>) 34else if (source is Iterator<TSource> iterator)
System\Linq\SkipTake.SpeedOpt.cs (9)
32private protected override Iterator<TSource> Clone() => 55public override Iterator<TSource>? Skip(int count) 61public override Iterator<TSource> Take(int count) 233private protected override Iterator<TSource> Clone() => 327public override Iterator<TSource>? Skip(int count) 353public override Iterator<TSource> Take(int count) 388if (_source is Iterator<TSource> iterator) 411if (_source is Iterator<TSource> iterator) 431if (_source is Iterator<TSource> iterator &&
System\Linq\Take.SpeedOpt.cs (4)
17source is Iterator<TSource> iterator ? (iterator.Take(count) ?? Empty<TSource>()) : 28source is Iterator<TSource> iterator ? TakeIteratorRange(iterator, startIndex, endIndex) : 32static IEnumerable<TSource> TakeIteratorRange(Iterator<TSource> iterator, int startIndex, int endIndex) 34Iterator<TSource>? source;
System\Linq\ToCollection.cs (2)
15if (source is Iterator<TSource> iterator) 68if (source is Iterator<TSource> iterator)
System\Linq\Union.cs (2)
226private protected override Iterator<TSource> Clone() => new UnionIterator2<TSource>(_first, _second, _comparer); 265private protected override Iterator<TSource> Clone() => new UnionIteratorN<TSource>(_sources, _headIndex, _comparer);
System\Linq\Where.cs (7)
24if (source is Iterator<TSource> iterator) 102private protected override Iterator<TSource> Clone() => new IEnumerableWhereIterator<TSource>(_source, _predicate); 166private protected override Iterator<TSource> Clone() => 214private protected override Iterator<TSource> Clone() => 271private protected override Iterator<TResult> Clone() => 320private protected override Iterator<TResult> Clone() => 375private protected override Iterator<TResult> Clone() =>