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