internal LinkedListEnumerator(Func <int> listVersionFactory, Nodes.LinkedListNode <T>?firstNode) { _listVersionFactory = listVersionFactory; _firstNode = firstNode; _currentNode = null; _initialListVersion = listVersionFactory(); }
public bool MoveNext() { ThrowIfListIsUpdated(); if (_currentNode == null) { _currentNode = _firstNode; return(true); } if (_currentNode.Next == _firstNode) { return(false); } _currentNode = _currentNode.Next; return(true); }
void IEnumerator.Reset() { ThrowIfListIsUpdated(); _currentNode = null; }