4 instantiations of ImmutableHashMap
Microsoft.CodeAnalysis.CodeStyle (4)
ImmutableHashMap.cs (4)
31private static readonly ImmutableHashMap<TKey, TValue> s_emptySingleton = new(); 219return new ImmutableHashMap<TKey, TValue>(_root, _keyComparer, valueComparer); 224var set = new ImmutableHashMap<TKey, TValue>(keyComparer, valueComparer); 516return root.Count == 0 ? this.Clear() : new ImmutableHashMap<TKey, TValue>(root, _keyComparer, _valueComparer);
41 references to ImmutableHashMap
Microsoft.CodeAnalysis.CodeStyle (41)
ImmutableHashMap.cs (37)
26[DebuggerTypeProxy(typeof(ImmutableHashMap<,>.DebuggerProxy))] 31private static readonly ImmutableHashMap<TKey, TValue> s_emptySingleton = new(); 49/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;"/> class. 64/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;"/> class. 77public static ImmutableHashMap<TKey, TValue> Empty => s_emptySingleton; 82public ImmutableHashMap<TKey, TValue> Clear() 91public ImmutableHashMap<TKey, TValue> Add(TKey key, TValue value) 94Contract.Ensures(Contract.Result<ImmutableHashMap<TKey, TValue>>() != null); 110public ImmutableHashMap<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs) 113Contract.Ensures(Contract.Result<ImmutableHashMap<TKey, TValue>>() != null); 122public ImmutableHashMap<TKey, TValue> SetItem(TKey key, TValue value) 125Contract.Ensures(Contract.Result<ImmutableHashMap<TKey, TValue>>() != null); 126Contract.Ensures(!Contract.Result<ImmutableHashMap<TKey, TValue>>().IsEmpty); 144public ImmutableHashMap<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items) 156public ImmutableHashMap<TKey, TValue> Remove(TKey key) 159Contract.Ensures(Contract.Result<ImmutableHashMap<TKey, TValue>>() != null); 172public ImmutableHashMap<TKey, TValue> RemoveRange(IEnumerable<TKey> keys) 175Contract.Ensures(Contract.Result<ImmutableHashMap<TKey, TValue>>() != null); 202public ImmutableHashMap<TKey, TValue> WithComparers(IEqualityComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer) 224var set = new ImmutableHashMap<TKey, TValue>(keyComparer, valueComparer); 239public ImmutableHashMap<TKey, TValue> WithComparers(IEqualityComparer<TKey> keyComparer) 490/// Attempts to discover an <see cref="ImmutableHashMap&lt;TKey, TValue&gt;"/> instance beneath some enumerable sequence 494/// <param name="other">Receives the concrete <see cref="ImmutableHashMap&lt;TKey, TValue&gt;"/> typed value if one can be found.</param> 496private static bool TryCastToImmutableMap(IEnumerable<KeyValuePair<TKey, TValue>> sequence, [NotNullWhen(true)] out ImmutableHashMap<TKey, TValue>? other) 498other = sequence as ImmutableHashMap<TKey, TValue>; 507private ImmutableHashMap<TKey, TValue> Wrap(Bucket? root) 529private ImmutableHashMap<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs, bool overwriteOnCollision, bool avoidToHashMap) 532Contract.Ensures(Contract.Result<ImmutableHashMap<TKey, TValue>>() != null); 539if (TryCastToImmutableMap(pairs, out var other)) 545var map = this; 604/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;.ValueOrListBucket"/> class. 617/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;.ValueBucket"/> class. 695/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;.ListBucket"/> class. 807/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;.HashBucket"/> class. 825/// Initializes a new instance of the <see cref="ImmutableHashMap&lt;TKey, TValue&gt;.HashBucket"/> class. 1039private readonly ImmutableHashMap<TKey, TValue> _map; 1050public DebuggerProxy(ImmutableHashMap<TKey, TValue> map)
ImmutableHashMapExtensions.cs (4)
24public static TValue? GetOrAdd<TKey, TValue, TArg>(ref ImmutableHashMap<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue?> valueProvider, TArg factoryArgument) 30var map = Volatile.Read(ref location); 45var augmentedMap = map.Add(key, newValue); 46var replacedMap = Interlocked.CompareExchange(ref location, augmentedMap, map);