Tip
If TKey is string and it is safe to use a non-randomized string comparer,
then you can pass StringSegmentComparer.Ordinal to the comparer parameter for better performance.
public ThreadSafeDictionary(
IEnumerable<KeyValuePair<TKey, TValue>> collection,
IEqualityComparer<TKey>? comparer = null,
HashingStrategy strategy = HashingStrategy.Auto
)
Public Sub New (
collection As IEnumerable(Of KeyValuePair(Of TKey, TValue)),
Optional comparer As IEqualityComparer(Of TKey) = Nothing,
Optional strategy As HashingStrategy = HashingStrategy.Auto
)
public:
ThreadSafeDictionary(
IEnumerable<KeyValuePair<TKey, TValue>>^ collection,
IEqualityComparer<TKey>^ comparer = nullptr,
HashingStrategy strategy = HashingStrategy::Auto
)
new :
collection : IEnumerable<KeyValuePair<'TKey, 'TValue>> *
?comparer : IEqualityComparer<'TKey> *
?strategy : HashingStrategy
(* Defaults:
let _comparer = defaultArg comparer null
let _strategy = defaultArg strategy HashingStrategy.Auto
*)
-> ThreadSafeDictionary