8 instantiations of SegmentedDictionary
Microsoft.CodeAnalysis.InteractiveHost (8)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
75
public static readonly ImmutableSegmentedDictionary<TKey, TValue> Empty = new(new
SegmentedDictionary
<TKey, TValue>());
285
return new ImmutableSegmentedDictionary<TKey, TValue>(new
SegmentedDictionary
<TKey, TValue>(keyComparer));
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (3)
51
_mutableDictionary = new
SegmentedDictionary
<TKey, TValue>(value);
104
_mutableDictionary = new
SegmentedDictionary
<TKey, TValue>(originalDictionary._dictionary, originalDictionary.KeyComparer);
136
_mutableDictionary = new
SegmentedDictionary
<TKey, TValue>(KeyComparer);
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (3)
395
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedDictionary
<TKey, TValue>(), Enumerator.KeyValuePair))!;
1364
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedDictionary
<TKey, TValue>()))!;
1572
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedDictionary
<TKey, TValue>()))!;
43 references to SegmentedDictionary
Microsoft.CodeAnalysis.InteractiveHost (43)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (2)
77
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
79
private ImmutableSegmentedDictionary(
SegmentedDictionary
<TKey, TValue> dictionary)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (2)
39
private
SegmentedDictionary
<TKey, TValue> ReadOnlyDictionary => _builder.ReadOnlyDictionary;
154
internal
SegmentedDictionary
<TKey, TValue> GetOrCreateMutableDictionary()
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Enumerator.cs (3)
16
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
18
private
SegmentedDictionary
<TKey, TValue>.Enumerator _enumerator;
20
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary, ReturnType returnType)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (6)
22
var
dictionary = Volatile.Read(ref Unsafe.AsRef(in location._dictionary));
31
var
dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
40
var
dictionary = Interlocked.CompareExchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary, comparand._dictionary);
51
/// <inheritdoc cref="SegmentedCollectionsMarshal.AsImmutableSegmentedDictionary{TKey, TValue}(
SegmentedDictionary
{TKey, TValue}?)"/>
52
internal static ImmutableSegmentedDictionary<TKey, TValue> AsImmutableSegmentedDictionary(
SegmentedDictionary
<TKey, TValue>? dictionary)
56
internal static
SegmentedDictionary
<TKey, TValue>? AsSegmentedDictionary(ImmutableSegmentedDictionary<TKey, TValue> dictionary)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (4)
27
private
SegmentedDictionary
<TKey, TValue>? _mutableDictionary;
50
var
valuesToAdd = ReadOnlyDictionary;
60
internal readonly
SegmentedDictionary
<TKey, TValue> ReadOnlyDictionary => _mutableDictionary ?? _dictionary._dictionary;
96
internal
SegmentedDictionary
<TKey, TValue> GetOrCreateMutableDictionary()
src\Dependencies\Collections\Segmented\SegmentedCollectionsMarshal.cs (11)
47
/// Gets either a ref to a <typeparamref name="TValue"/> in the <see cref="
SegmentedDictionary
{TKey, TValue}"/> or a
55
/// Items should not be added or removed from the <see cref="
SegmentedDictionary
{TKey, TValue}"/> while the ref
59
public static ref TValue GetValueRefOrNullRef<TKey, TValue>(
SegmentedDictionary
<TKey, TValue> dictionary, TKey key)
61
=> ref
SegmentedDictionary
<TKey, TValue>.PrivateMarshal.FindValue(dictionary, key);
182
/// Gets an <see cref="ImmutableSegmentedDictionary{TKey, TValue}"/> value wrapping the input <see cref="
SegmentedDictionary
{TKey, TValue}"/>.
201
public static ImmutableSegmentedDictionary<TKey, TValue> AsImmutableSegmentedDictionary<TKey, TValue>(
SegmentedDictionary
<TKey, TValue>? dictionary)
206
/// Gets the underlying <see cref="
SegmentedDictionary
{TKey, TValue}"/> for an input <see cref="ImmutableSegmentedDictionary{TKey, TValue}"/> value.
210
/// <param name="dictionary">The input <see cref="ImmutableSegmentedDictionary{TKey, TValue}"/> value to get the underlying <see cref="
SegmentedDictionary
{TKey, TValue}"/> from.</param>
211
/// <returns>The underlying <see cref="
SegmentedDictionary
{TKey, TValue}"/> for <paramref name="dictionary"/>, if present; otherwise, <see langword="null"/>.</returns>
220
/// property is <see langword="true"/>), the resulting <see cref="
SegmentedDictionary
{TKey, TValue}"/> will be <see langword="null"/>.
223
public static
SegmentedDictionary
<TKey, TValue>? AsSegmentedDictionary<TKey, TValue>(ImmutableSegmentedDictionary<TKey, TValue> dictionary)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
156
if (enumerable.GetType() == typeof(
SegmentedDictionary
<TKey, TValue>))
158
var
source = (
SegmentedDictionary
<TKey, TValue>)enumerable;
1174
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1183
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary, int getEnumeratorRetType)
1298
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1300
public KeyCollection(
SegmentedDictionary
<TKey, TValue> dictionary)
1432
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1437
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary)
1506
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1508
public ValueCollection(
SegmentedDictionary
<TKey, TValue> dictionary)
1640
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1645
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2+PrivateMarshal.cs (2)
16
/// <inheritdoc cref="SegmentedCollectionsMarshal.GetValueRefOrNullRef{TKey, TValue}(
SegmentedDictionary
{TKey, TValue}, TKey)"/>
17
public static ref TValue FindValue(
SegmentedDictionary
<TKey, TValue> dictionary, TKey key)