Min()
/Max()
on SortedSet<T>
CS-P1025The methods Min()
and Max()
come from the Enumerable
interface defined in System.Linq
.
While they may be appropriate for other structures and scenarios, they are not performant for SortedSet<T>
.
Consider using Sorted<T>
's own properties Min
and Max
as they're efficient and tailored for this very purpose.
var min = set.Min();
var min = set.Min;