/// Returning an instance of this type is useful to quickly handle scenarios where it is known
/// that an operation will result in zero elements.
/// </remarks>
+ [DebuggerDisplay("Count = 0")]
internal sealed class EmptyPartition<TElement> : IPartition<TElement>, IEnumerator<TElement>
{
/// <summary>
/// An iterator that yields the items of part of an <see cref="IList{TSource}"/>.
/// </summary>
/// <typeparam name="TSource">The type of the source list.</typeparam>
+ [DebuggerDisplay("Count = {Count}")]
private sealed class ListPartition<TSource> : Iterator<TSource>, IPartition<TSource>
{
private readonly IList<TSource> _source;
/// <summary>
/// An iterator that yields a range of consecutive integers.
/// </summary>
+ [DebuggerDisplay("Count = {CountForDebugger}")]
private sealed partial class RangeIterator : Iterator<int>
{
private readonly int _start;
_end = unchecked(start + count);
}
+ private int CountForDebugger => _end - _start;
+
public override Iterator<int> Clone() => new RangeIterator(_start, _end - _start);
public override bool MoveNext()
/// </summary>
/// <typeparam name="TSource">The type of the source list.</typeparam>
/// <typeparam name="TResult">The type of the mapped items.</typeparam>
+ [DebuggerDisplay("Count = {Count}")]
private sealed class SelectListPartitionIterator<TSource, TResult> : Iterator<TResult>, IPartition<TResult>
{
private readonly IList<TSource> _source;
/// </summary>
/// <typeparam name="TSource">The type of the source array.</typeparam>
/// <typeparam name="TResult">The type of the mapped items.</typeparam>
+ [DebuggerDisplay("Count = {CountForDebugger}")]
private sealed partial class SelectArrayIterator<TSource, TResult> : Iterator<TResult>
{
private readonly TSource[] _source;
_selector = selector;
}
+ private int CountForDebugger => _source.Length;
+
public override Iterator<TResult> Clone() => new SelectArrayIterator<TSource, TResult>(_source, _selector);
public override bool MoveNext()
/// </summary>
/// <typeparam name="TSource">The type of the source list.</typeparam>
/// <typeparam name="TResult">The type of the mapped items.</typeparam>
+ [DebuggerDisplay("Count = {CountForDebugger}")]
private sealed partial class SelectListIterator<TSource, TResult> : Iterator<TResult>
{
private readonly List<TSource> _source;
_selector = selector;
}
+ private int CountForDebugger => _source.Count;
+
public override Iterator<TResult> Clone() => new SelectListIterator<TSource, TResult>(_source, _selector);
public override bool MoveNext()
/// </summary>
/// <typeparam name="TSource">The type of the source list.</typeparam>
/// <typeparam name="TResult">The type of the mapped items.</typeparam>
+ [DebuggerDisplay("Count = {CountForDebugger}")]
private sealed partial class SelectIListIterator<TSource, TResult> : Iterator<TResult>
{
private readonly IList<TSource> _source;
_selector = selector;
}
+ private int CountForDebugger => _source.Count;
+
public override Iterator<TResult> Clone() => new SelectIListIterator<TSource, TResult>(_source, _selector);
public override bool MoveNext()