// Copyright (c) Ben A Adams. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace DTLib.Ben.Demystifier.Enumerable; public struct EnumeratorIList : IEnumerator { private readonly IList _list; private int _index; public EnumeratorIList(IList list) { _index = -1; _list = list; } public T Current => _list[_index]; public bool MoveNext() { _index++; return _index < (_list?.Count ?? 0); } public void Dispose() { } object? IEnumerator.Current => Current; public void Reset() { _index = -1; } }