Is anyone aware of whether there are there any built-in capabilities in the LINQ library (or a publicly available utility library) for optimized operations on IOrderedEnumerable<T>
, as opposed to IEnumerable<T>
?
For example, in theory, the Contains<T>()
extension could potentially be optimized to use binary search when it is applied to a finite IOrderedEnumerable<T>
and T is IComparable.
Another example, would be an optimized version of Distinct<T>()
that would be deferred and streamable (since on an ordered, comparable collection you can always use skip/match techniques to produce a distinct set).