private ConsEnumerable() { _node = new ConsNode <T> { State = StartNode }; }
public bool MoveNext() { if (!AdvanceToNextNode()) { return(false); } if (_node.State == HasEnumeration) { _node.Enumerating(new ConsListBuilderEnumerator <ConsNode <T>, T>(_node)); } if (_node.State == HasValue) { return(true); } if (_node.Enumerator.MoveNext()) { var newNode = new ConsNode <T> { Next = _node.Next }; newNode.Enumerating(_node.Enumerator); _node.HasValue(_node.Enumerator.Current.Value); _node.Next = newNode; return(true); } _node.IgnoredNode(); return(MoveNext()); }
private ConsEnumerable(ConsNode <T> node) { _node = new ConsNode <T> { State = StartNode, Next = node }; }
internal ConsEnumerable(IEnumerable <T> enumeration) { _node = _node = new ConsNode <T> { State = StartNode, Next = new ConsNode <T> { State = HasEnumeration, Enumeration = enumeration } }; }
private ConsEnumerable(IEnumerable <T> enumeration, IEnumerable <T> head) { _node = new ConsNode <T> { State = StartNode, Next = new ConsNode <T> { Enumeration = head, State = HasEnumeration, Next = new ConsNode <T> { Enumeration = enumeration, State = HasEnumeration } } }; }
private bool AdvanceToNextNode() { _node = _node.Next; if (_node == null) { Dispose(); return(false); } while (_node.State == IgnoredNode) { _node = _node.Next; if (_node == null) { Dispose(); return(false); } } return(true); }
internal ConsEnumerable(ConsNode <T> node) =>
internal ConsListBuilderEnumerator(ConsNode <T> node) => _enumerator = node.Enumeration.GetEnumerator();
public ConsNodeEnumerator(ConsNode <T> node) => Node = node;
private ConsEnumerable(ConsNode <T> node) =>