public T this[int index] { get { if (index < 0 || index >= m_items.Count) { ThrowIndexOutOfRangeException(); } int offset; int level = ColaStore.MapOffsetToLocation(m_items.Count, index, out offset); Contract.Assert(level >= 0); return(m_items.GetAt(level, offset)); } }
public T RemoveAt(int arrayIndex) { if (arrayIndex < 0 || arrayIndex >= m_items.Count) { throw new ArgumentOutOfRangeException("arrayIndex", "Index is outside the array"); } int offset; int level = ColaStore.MapOffsetToLocation(m_items.Count, arrayIndex, out offset); Contract.Assert(level >= 0 && offset >= 0 && offset < 1 << level); ++m_version; return(m_items.RemoveAt(level, offset)); }