LINQ IEnumerable extension methods should add special case IReadOnlyCollection\<T\. For example, this line https://github.com/dotnet/runtime/blob/271f008f0fe8168dacac45cd3ce1952e6e32bfbb/src/libraries/System.Linq/src/System/Linq/Count.cs#L18 shows an optimization for ICollection\<TSource\>, yet IReadOnlyCollection\<TSource\> will result in a full iteration.
Activity
huoyaoyuan commentedon Oct 3, 2020
#42254 (comment)
stephentoub commentedon Oct 5, 2020
Closing as dup of #42254. Thanks.