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

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

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

static IEnumerable DistinctIterator(IEnumerable

        
1条回答
  •  旧时难觅i
    2021-02-19 00:00

    The implementation of this Set is far simpler than HashSet 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)
提交回复
热议问题