Special-case array/list in Dictionary(IEnumerable, …) ctors (#86254)
authorStephen Toub <stoub@microsoft.com>
Wed, 17 May 2023 14:23:45 +0000 (10:23 -0400)
committerGitHub <noreply@github.com>
Wed, 17 May 2023 14:23:45 +0000 (10:23 -0400)
commit709444f29ebc548c5d33e5993d4d7bb01a5d3520
tree06e614a5ccc40acbc85c49d57029aa1253c394b0
parent7c72ba5c91f040eeff249b36525262ad75bbf1d0
Special-case array/list in Dictionary(IEnumerable, …) ctors (#86254)

* Special-case array/list in Dictionary(IEnumerable, ...) ctors

It's reasonably common to construct a dictionary from a `KeyValuePair<TKey, TValue>[]` or a `List<KeyValuePair<TKey, TValue>>`, and we can make both cheaper.
src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs