System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext C# (CSharp) Method

MoveNext() public method

public MoveNext ( ) : bool
return bool
            public bool MoveNext()
            {
                if (_version != _list._version)
                {
                    throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion);
                }

                if (_isArrayList)
                {  // avoid calling virtual methods if we are operating on ArrayList to improve performance
                    if (_index < _list._size - 1)
                    {
                        _currentElement = _list._items[++_index];
                        return true;
                    }
                    else
                    {
                        _currentElement = s_dummyObject;
                        _index = _list._size;
                        return false;
                    }
                }
                else
                {
                    if (_index < _list.Count - 1)
                    {
                        _currentElement = _list[++_index];
                        return true;
                    }
                    else
                    {
                        _index = _list.Count;
                        _currentElement = s_dummyObject;
                        return false;
                    }
                }
            }