Exemple #1
0
        public void Sort(int index, int count, Comparison <T> comp)
        {
            Debug.Assert((uint)index <= (uint)_count);
            Debug.Assert((uint)count <= (uint)_count - (uint)index);

            if (!IsDivided)
            {
                InternalList.Sort(_array, _start + index, count, comp);
            }
            else if (index == 0 && count == Count)
            {
                Sort(comp);
            }
            else
            {
                // Use a slower IList<T> sort because the array sort requires contiguous input
                ListExt.Sort(AsDList(), index, count, comp);
            }
        }