internal Enumerator(ReferenceEqualityList <T> list) { this.list = list; index = 0; version = list._version; current = default(T); }
public bool MoveNext() { ReferenceEqualityList <T> localList = list; if (version == localList._version && ((uint)index < (uint)localList._size)) { current = localList._items[index]; index++; return(true); } return(MoveNextRare()); }
public ReferenceEqualityList <TOutput> ConvertAll <TOutput>(Converter <T, TOutput> converter) { if (converter is null) { throw new ArgumentNullException("converter"); } // @ var list = new ReferenceEqualityList <TOutput>(_size); for (int i = 0; i < _size; i++) { list._items[i] = converter(_items[i]); } list._size = _size; return(list); }
public ReferenceEqualityList <T> GetRange(int index, int count) { if (index < 0) { throw new ArgumentOutOfRangeException("index"); } if (count < 0) { throw new ArgumentOutOfRangeException("count"); } if (_size - index < count) { throw new ArgumentException(); } var list = new ReferenceEqualityList <T>(count); Array.Copy(_items, index, list._items, 0, count); list._size = count; return(list); }
internal SynchronizedList(ReferenceEqualityList <T> list) { _list = list; _root = ((ICollection)list).SyncRoot; }
internal static IList <T> Synchronized(ReferenceEqualityList <T> list) { return(new SynchronizedList(list)); }