Internal System.Linq.Set vs public System.Collections.Generic.HashSet

前端 未结 1 1671
一整个雨季
一整个雨季 2021-02-18 23:09

Check out this piece of code from Linq.Enumerable class:

static IEnumerable DistinctIterator(IEnumerable

        
相关标签:
1条回答
  • 2021-02-19 00:00

    The implementation of this Set<T> is far simpler than HashSet<T> as it is only needs to add and remove elements and check for existence for LINQ internal processes. It does not implement any interfaces or expose iterators etc.

    So probably it is faster for the purpose LINQ uses it for.

    0 讨论(0)
提交回复
热议问题