Why does Dictionary in C# Have a .Distinct() Extension? -
as title says, why dictionary collection in c# contain .distinct() extension if it's possible dictionary contain non-distinct keys? there legitimate reasoning behind or reading far it?
dictionary<tkey, tvalue>
implements ienumerable<keyvaluepair<tkey, tvalue>>
has distinct
extension. dictionary
class doesn't have implementation of distinct
calling distinct
translated call static extension method:
enueramble.distinct(ienumerable<t> source)
which unneccesary dictionary
since keys distinct (and hence key/value pairs distinct) technically there's nothing wrong it.
Comments
Post a Comment