SortedSet Linq Extension Method





5.00/5 (7 votes)
Since SortedSet has a constructor that takes an IEnumerable parameter, the ToSortedSet extension method can be greatly simplified:public static SortedSet ToSortedSet(this IEnumerable t){ return new SortedSet(t);}
Since SortedSet has a constructor that takes an IEnumerable<T> parameter, the ToSortedSet extension method can be greatly simplified:
public static SortedSet<T> ToSortedSet<T>(this IEnumerable<T> t)
{
return new SortedSet<T>(t);
}