public int IndexOf(T item) { var cacheIndex = _cache.IndexOf(item, Comparer); if (cacheIndex >= 0) { return(cacheIndex); } var index = _cache.Count - 1; var found = false; Progressor.While ( input => { index++; if (Comparer.Equals(input, item)) { found = true; return(false); } return(true); } ).Consume(); if (found) { return(index); } return(-1); }
public T this[int index] { get { if (index >= _cache.Count) { Progressor.While(() => _cache.Count < index + 1).Consume(); } return(_cache[index]); } }
public void CopyTo(KeyValuePair <TKey, IGrouping <TKey, T> >[] array, int arrayIndex, int countLimit) { Extensions.CanCopyTo(array, arrayIndex, countLimit); _progressor.While(() => _cache.Count < countLimit).Consume(); _cache.CopyTo(array, arrayIndex, countLimit); }
public void CopyTo(T[] array, int arrayIndex, int countLimit) { Extensions.CanCopyTo(array, arrayIndex, countLimit); _progressor.While(() => _cache.Count < countLimit).Consume(); _cache.CopyTo(array, arrayIndex, countLimit); }