Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations (#85288)
* Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations * Fix BinaryFormatter test The test was implemented using ToList, and `List<T>` serialization serializes out its version field. As a result, because we're now optimizing creation and not incrementing the version as much in ToList, the blob didn't match.
Showing
想要评论请 注册 或 登录