The enumerable returned by Skip() can implement IList and then FirstOrDefault() can use the indexer to get the first item. That's how it's implemented in Hyperlinq.
That's perfectly valid implementation. The last example was just me having fun and de-virtualizing everything :) The performance was something else though. That gives me an idea to construct a version of de-virt linq having one global Enumerable struct will all of the needed information and construct our LINQ contract on that.
4 года назад
@@LevelUppp Hyperlinq is fully devirtualized but I'd love to see our take on that.