public static void EnsureSingleEnumerationDEBUGSorted <T>(ref ISortedEnumerable <T> sequence) { if (sequence != null) { sequence = new SortedList <T>(sequence.ToList(), sequence.Comparer); } }
/// <summary> Caches the specified sorted sequence in a sorted list. </summary> public static SortedList <T> ToSortedList <T>(this ISortedEnumerable <T> sequence) { return(new SortedList <T>(sequence.ToList(), sequence.Comparer)); }
/// <summary> /// Creates a sorted list from a sorted source sequence. /// </summary> /// <typeparam name="T">The type of items in the sequence.</typeparam> /// <param name="source">The source sequence.</param> /// <returns>The sorted list.</returns> public static ISortedList <T> ToSortedList <T>(this ISortedEnumerable <T> source) { return(new SortedListWrapper <T>(source.ToList(), source.Comparer)); }