I have a linq query with an orderby. I'm expecting linq to optimize the code, so the orderby descending and the a call to First() are optimized against each other to form a Max operation, which is algorithmically is a linear time operation, not a log(N) like orderby on it's own. Is my expectation correct, or i'm expecting too much from linq? Here is the code i'm using, which i believe can work as a linear time operation: using System; using System.Linq; using System.Text.RegularExpressions; namespace
Read More...