3 ms·
Some implementations of IEnumerable do have a Count property on them. He's specifically talking about the Count() extension method. Since this extension method
by RexM 13y ago
Some implementations of IEnumerable do have a Count property on them. He's specifically talking about the Count() extension method. Since this extension method applies to all IEnumerable<T> implementations, there may or may not be an optimized way of accessing the count, and this method would need to know about them. The code looks a little something like this (decompiled from the .NET framework, so the variable names are probably not true to what they're actually named in the real source)
https://gist.github.com/anonymous/7c2c65268feafa66fb02 https://gist.github.com/anonymous/7c2c65268feafa66fb02