jtmueller / Collections.Pooled

Fast, low-allocation ports of List, Dictionary, HashSet, Stack, and Queue using ArrayPool and Span.
MIT License
538 stars 47 forks source link

Add support for Tuple<TKey, TValue> to dictionary constructor/AddRange #17

Closed jtmueller closed 5 years ago

jtmueller commented 5 years ago

Is your feature request related to a problem? Please describe. We already support ValueTuple, but there are cases where support for Tuple would be convenient, particularly in F# to make an equivalent to the dict function.

Describe the solution you'd like Constructors, AddRange, and extension methods for PooledDictionary should support IEnumerable<Tuple<TKey, TValue>>. No need to support spans of same.

jtmueller commented 5 years ago

Ended up doing this as an extension method, not a constructor. There's already quite a lot of constructors.