10 instantiations of ImmutableSegmentedDictionary
Microsoft.CodeAnalysis (10)
ImmutableSegmentedDictionary`2.cs (6)
73
public static readonly ImmutableSegmentedDictionary<TKey, TValue> Empty =
new
(new SegmentedDictionary<TKey, TValue>());
152
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
179
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
216
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
239
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
295
return new
ImmutableSegmentedDictionary
<TKey, TValue>(new SegmentedDictionary<TKey, TValue>(keyComparer));
ImmutableSegmentedDictionary`2+Builder.cs (1)
217
_dictionary = new
ImmutableSegmentedDictionary
<TKey, TValue>(ReadOnlyDictionary);
ImmutableSegmentedDictionary`2+PrivateInterlocked.cs (3)
23
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
32
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
41
return new
ImmutableSegmentedDictionary
<TKey, TValue>(dictionary);
271 references to ImmutableSegmentedDictionary
Microsoft.CodeAnalysis (181)
Collections\ImmutableSegmentedDictionaryBuilderExtensions.cs (1)
13
this
ImmutableSegmentedDictionary
<T, VoidResult>.Builder dictionary,
DiagnosticAnalyzer\AnalyzerDriver.cs (12)
154
private
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, SemaphoreSlim> _lazyAnalyzerGateMap;
155
private
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, SemaphoreSlim> AnalyzerGateMap
164
private
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> _lazyGeneratedCodeAnalysisFlagsMap;
169
private
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> GeneratedCodeAnalysisFlagsMap
381
_lazyAnalyzerGateMap =
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, SemaphoreSlim>.Empty;
557
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap,
574
private static bool ComputeShouldTreatAllCodeAsNonGeneratedCode(ImmutableHashSet<DiagnosticAnalyzer> analyzers,
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap)
595
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags> generatedCodeAnalysisFlagsMap,
2127
private static async Task<
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, SemaphoreSlim>> CreateAnalyzerGateMapAsync(
2150
private static async Task<
ImmutableSegmentedDictionary
<DiagnosticAnalyzer, GeneratedCodeAnalysisFlags>> CreateGeneratedCodeAnalysisFlagsMapAsync(
2513
var
nodeActionsByKind = groupedActionsForAnalyzer.NodeActionsByAnalyzerAndKind;
2621
var
operationActionsByKind = groupedActionsForAnalyzer.OperationActionsByAnalyzerAndKind;
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActionsForAnalyzer.cs (8)
19
private
ImmutableSegmentedDictionary
<TLanguageKindEnum, ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>> _lazyNodeActionsByKind;
20
private
ImmutableSegmentedDictionary
<OperationKind, ImmutableArray<OperationAnalyzerAction>> _lazyOperationActionsByKind;
67
public
ImmutableSegmentedDictionary
<TLanguageKindEnum, ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>> NodeActionsByAnalyzerAndKind
77
var
analyzerActionsByKind = !nodeActions.IsEmpty ?
79
ImmutableSegmentedDictionary
<TLanguageKindEnum, ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>>.Empty;
87
public
ImmutableSegmentedDictionary
<OperationKind, ImmutableArray<OperationAnalyzerAction>> OperationActionsByAnalyzerAndKind
95
var
analyzerActionsByKind = operationActions.Any() ?
97
ImmutableSegmentedDictionary
<OperationKind, ImmutableArray<OperationAnalyzerAction>>.Empty;
DiagnosticAnalyzer\AnalyzerExecutor.cs (10)
866
var
executableNodeActionsByKind = GetNodeActionsByKind(syntaxNodeActions);
872
var
operationActionsByKind = GetOperationActionsByKind(operationActions);
934
internal static
ImmutableSegmentedDictionary
<TLanguageKindEnum, ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>> GetNodeActionsByKind<TLanguageKindEnum>(
955
var
map = ImmutableSegmentedDictionary.CreateRange(tuples);
965
ImmutableSegmentedDictionary
<TLanguageKindEnum, ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>> nodeActionsByKind,
989
ImmutableSegmentedDictionary
<TLanguageKindEnum, ImmutableArray<SyntaxNodeAnalyzerAction<TLanguageKindEnum>>> nodeActionsByKind,
1022
internal static
ImmutableSegmentedDictionary
<OperationKind, ImmutableArray<OperationAnalyzerAction>> GetOperationActionsByKind(IEnumerable<OperationAnalyzerAction> operationActions)
1041
var
map = ImmutableSegmentedDictionary.CreateRange(tuples);
1055
ImmutableSegmentedDictionary
<OperationKind, ImmutableArray<OperationAnalyzerAction>> operationActionsByKind,
1077
ImmutableSegmentedDictionary
<OperationKind, ImmutableArray<OperationAnalyzerAction>> operationActionsByKind,
ImmutableSegmentedDictionary.cs (21)
17
public static
ImmutableSegmentedDictionary
<TKey, TValue> Create<TKey, TValue>()
19
=>
ImmutableSegmentedDictionary
<TKey, TValue>.Empty;
21
public static
ImmutableSegmentedDictionary
<TKey, TValue> Create<TKey, TValue>(IEqualityComparer<TKey>? keyComparer)
23
=>
ImmutableSegmentedDictionary
<TKey, TValue>.Empty.WithComparer(keyComparer);
25
public static
ImmutableSegmentedDictionary
<TKey, TValue>.Builder CreateBuilder<TKey, TValue>()
29
public static
ImmutableSegmentedDictionary
<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IEqualityComparer<TKey>? keyComparer)
33
public static
ImmutableSegmentedDictionary
<TKey, TValue> CreateRange<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>> items)
35
=>
ImmutableSegmentedDictionary
<TKey, TValue>.Empty.AddRange(items);
37
public static
ImmutableSegmentedDictionary
<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEnumerable<KeyValuePair<TKey, TValue>> items)
39
=>
ImmutableSegmentedDictionary
<TKey, TValue>.Empty.WithComparer(keyComparer).AddRange(items);
41
public static
ImmutableSegmentedDictionary
<TKey, TValue> ToImmutableSegmentedDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> items)
45
public static
ImmutableSegmentedDictionary
<TKey, TValue> ToImmutableSegmentedDictionary<TKey, TValue>(this
ImmutableSegmentedDictionary
<TKey, TValue>.Builder builder)
54
public static
ImmutableSegmentedDictionary
<TKey, TValue> ToImmutableSegmentedDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> items, IEqualityComparer<TKey>? keyComparer)
60
if (items is
ImmutableSegmentedDictionary
<TKey, TValue> existingDictionary)
63
return
ImmutableSegmentedDictionary
<TKey, TValue>.Empty.WithComparer(keyComparer).AddRange(items);
66
public static
ImmutableSegmentedDictionary
<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector)
70
public static
ImmutableSegmentedDictionary
<TKey, TValue> ToImmutableSegmentedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer)
80
return
ImmutableSegmentedDictionary
<TKey, TValue>.Empty.WithComparer(keyComparer)
84
public static
ImmutableSegmentedDictionary
<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
88
public static
ImmutableSegmentedDictionary
<TKey, TSource> ToImmutableSegmentedDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer)
ImmutableSegmentedDictionary`2.cs (35)
17
/// <para>There are different scenarios best for <see cref="
ImmutableSegmentedDictionary
{TKey, TValue}"/> and others
20
/// <para>In general, <see cref="
ImmutableSegmentedDictionary
{TKey, TValue}"/> is applicable in scenarios most like
26
/// <see cref="
ImmutableSegmentedDictionary
{TKey, TValue}"/>:</para>
31
/// <description><see cref="
ImmutableSegmentedDictionary
{TKey, TValue}"/> Complexity</description>
70
internal readonly partial struct ImmutableSegmentedDictionary<TKey, TValue> : IImmutableDictionary<TKey, TValue>, IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IDictionary, IEquatable<
ImmutableSegmentedDictionary
<TKey, TValue>>
73
public static readonly
ImmutableSegmentedDictionary
<TKey, TValue> Empty = new(new SegmentedDictionary<TKey, TValue>());
132
public static bool operator ==(
ImmutableSegmentedDictionary
<TKey, TValue> left,
ImmutableSegmentedDictionary
<TKey, TValue> right)
135
public static bool operator !=(
ImmutableSegmentedDictionary
<TKey, TValue> left,
ImmutableSegmentedDictionary
<TKey, TValue> right)
138
public static bool operator ==(
ImmutableSegmentedDictionary
<TKey, TValue>? left,
ImmutableSegmentedDictionary
<TKey, TValue>? right)
141
public static bool operator !=(
ImmutableSegmentedDictionary
<TKey, TValue>? left,
ImmutableSegmentedDictionary
<TKey, TValue>? right)
144
public
ImmutableSegmentedDictionary
<TKey, TValue> Add(TKey key, TValue value)
146
var
self = this;
155
public
ImmutableSegmentedDictionary
<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)
157
var
self = this;
160
if (self.IsEmpty && TryCastToImmutableSegmentedDictionary(pairs, out
var
other) && self.KeyComparer == other.KeyComparer)
182
public
ImmutableSegmentedDictionary
<TKey, TValue> Clear()
184
var
self = this;
208
public
ImmutableSegmentedDictionary
<TKey, TValue> Remove(TKey key)
210
var
self = this;
219
public
ImmutableSegmentedDictionary
<TKey, TValue> RemoveRange(IEnumerable<TKey> keys)
229
public
ImmutableSegmentedDictionary
<TKey, TValue> SetItem(TKey key, TValue value)
231
var
self = this;
242
public
ImmutableSegmentedDictionary
<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items)
258
var
self = this;
277
public
ImmutableSegmentedDictionary
<TKey, TValue> WithComparer(IEqualityComparer<TKey>? keyComparer)
281
var
self = this;
312
return obj is
ImmutableSegmentedDictionary
<TKey, TValue> other
316
public bool Equals(
ImmutableSegmentedDictionary
<TKey, TValue> other)
381
private static bool TryCastToImmutableSegmentedDictionary(IEnumerable<KeyValuePair<TKey, TValue>> pairs, out
ImmutableSegmentedDictionary
<TKey, TValue> other)
383
if (pairs is
ImmutableSegmentedDictionary
<TKey, TValue> dictionary)
389
if (pairs is
ImmutableSegmentedDictionary
<TKey, TValue>.Builder builder)
ImmutableSegmentedDictionary`2+Builder.cs (3)
19
private
ImmutableSegmentedDictionary
<TKey, TValue> _dictionary;
27
internal Builder(
ImmutableSegmentedDictionary
<TKey, TValue> dictionary)
215
public
ImmutableSegmentedDictionary
<TKey, TValue> ToImmutable()
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (3)
18
private readonly
ImmutableSegmentedDictionary
<TKey, TValue>.Builder _dictionary;
20
internal KeyCollection(
ImmutableSegmentedDictionary
<TKey, TValue>.Builder dictionary)
46
public
ImmutableSegmentedDictionary
<TKey, TValue>.KeyCollection.Enumerator GetEnumerator()
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (3)
18
private readonly
ImmutableSegmentedDictionary
<TKey, TValue>.Builder _dictionary;
20
internal ValueCollection(
ImmutableSegmentedDictionary
<TKey, TValue>.Builder dictionary)
46
public
ImmutableSegmentedDictionary
<TKey, TValue>.ValueCollection.Enumerator GetEnumerator()
ImmutableSegmentedDictionary`2+Enumerator.cs (1)
38
/// <see cref="
ImmutableSegmentedDictionary
{TKey, TValue}"/>.
ImmutableSegmentedDictionary`2+KeyCollection.cs (2)
15
private readonly
ImmutableSegmentedDictionary
<TKey, TValue> _dictionary;
17
internal KeyCollection(
ImmutableSegmentedDictionary
<TKey, TValue> dictionary)
ImmutableSegmentedDictionary`2+KeyCollection+Enumerator.cs (2)
16
private
ImmutableSegmentedDictionary
<TKey, TValue>.Enumerator _enumerator;
18
internal Enumerator(
ImmutableSegmentedDictionary
<TKey, TValue>.Enumerator enumerator)
ImmutableSegmentedDictionary`2+PrivateInterlocked.cs (9)
17
internal static
ImmutableSegmentedDictionary
<TKey, TValue> VolatileRead(in
ImmutableSegmentedDictionary
<TKey, TValue> location)
26
internal static
ImmutableSegmentedDictionary
<TKey, TValue> InterlockedExchange(ref
ImmutableSegmentedDictionary
<TKey, TValue> location,
ImmutableSegmentedDictionary
<TKey, TValue> value)
35
internal static
ImmutableSegmentedDictionary
<TKey, TValue> InterlockedCompareExchange(ref
ImmutableSegmentedDictionary
<TKey, TValue> location,
ImmutableSegmentedDictionary
<TKey, TValue> value,
ImmutableSegmentedDictionary
<TKey, TValue> comparand)
ImmutableSegmentedDictionary`2+ValueCollection.cs (2)
15
private readonly
ImmutableSegmentedDictionary
<TKey, TValue> _dictionary;
17
internal ValueCollection(
ImmutableSegmentedDictionary
<TKey, TValue> dictionary)
ImmutableSegmentedDictionary`2+ValueCollection+Enumerator.cs (2)
16
private
ImmutableSegmentedDictionary
<TKey, TValue>.Enumerator _enumerator;
18
internal Enumerator(
ImmutableSegmentedDictionary
<TKey, TValue>.Enumerator enumerator)
RoslynImmutableInterlocked.cs (62)
273
public static bool Update<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, Func<
ImmutableSegmentedDictionary
<TKey, TValue>,
ImmutableSegmentedDictionary
<TKey, TValue>> transformer)
279
var
oldValue =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
282
var
newValue = transformer(oldValue);
289
var
interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue);
316
public static bool Update<TKey, TValue, TArg>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, Func<
ImmutableSegmentedDictionary
<TKey, TValue>, TArg,
ImmutableSegmentedDictionary
<TKey, TValue>> transformer, TArg transformerArgument)
322
var
oldValue =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
325
var
newValue = transformer(oldValue, transformerArgument);
332
var
interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue);
349
public static
ImmutableSegmentedDictionary
<TKey, TValue> InterlockedExchange<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location,
ImmutableSegmentedDictionary
<TKey, TValue> value)
352
return
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.InterlockedExchange(ref location, value);
365
public static
ImmutableSegmentedDictionary
<TKey, TValue> InterlockedCompareExchange<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location,
ImmutableSegmentedDictionary
<TKey, TValue> value,
ImmutableSegmentedDictionary
<TKey, TValue> comparand)
368
return
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.InterlockedCompareExchange(ref location, value, comparand);
381
public static bool InterlockedInitialize<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location,
ImmutableSegmentedDictionary
<TKey, TValue> value)
384
return InterlockedCompareExchange(ref location, value, default(
ImmutableSegmentedDictionary
<TKey, TValue>)).IsDefault;
388
public static TValue GetOrAdd<TKey, TValue, TArg>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
394
var
map =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
408
public static TValue GetOrAdd<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory)
414
var
map =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
428
public static TValue GetOrAdd<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, TValue value)
431
var
priorCollection =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
442
var
updatedCollection = priorCollection.Add(key, value);
443
var
interlockedResult = InterlockedCompareExchange(ref location, updatedCollection, priorCollection);
456
public static TValue AddOrUpdate<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
465
var
priorCollection =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
480
var
updatedCollection = priorCollection.SetItem(key, newValue);
481
var
interlockedResult = InterlockedCompareExchange(ref location, updatedCollection, priorCollection);
494
public static TValue AddOrUpdate<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
501
var
priorCollection =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
516
var
updatedCollection = priorCollection.SetItem(key, newValue);
517
var
interlockedResult = InterlockedCompareExchange(ref location, updatedCollection, priorCollection);
530
public static bool TryAdd<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, TValue value)
533
var
priorCollection =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
544
var
updatedCollection = priorCollection.Add(key, value);
545
var
interlockedResult = InterlockedCompareExchange(ref location, updatedCollection, priorCollection);
556
public static bool TryUpdate<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, TValue newValue, TValue comparisonValue)
560
var
priorCollection =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
572
var
updatedCollection = priorCollection.SetItem(key, newValue);
573
var
interlockedResult = InterlockedCompareExchange(ref location, updatedCollection, priorCollection);
584
public static bool TryRemove<TKey, TValue>(ref
ImmutableSegmentedDictionary
<TKey, TValue> location, TKey key, [MaybeNullWhen(false)] out TValue value)
587
var
priorCollection =
ImmutableSegmentedDictionary
<TKey, TValue>.PrivateInterlocked.VolatileRead(in location);
598
var
updatedCollection = priorCollection.Remove(key);
599
var
interlockedResult = InterlockedCompareExchange(ref location, updatedCollection, priorCollection);
SourceGeneration\Nodes\StateTableStore.cs (4)
16
private readonly
ImmutableSegmentedDictionary
<object, IStateTable> _tables;
18
public static readonly StateTableStore Empty = new StateTableStore(
ImmutableSegmentedDictionary
<object, IStateTable>.Empty);
20
private StateTableStore(
ImmutableSegmentedDictionary
<object, IStateTable> tables)
43
private readonly
ImmutableSegmentedDictionary
<object, IStateTable>.Builder _tableBuilder = ImmutableSegmentedDictionary.CreateBuilder<object, IStateTable>();
Syntax\SyntaxNodeExtensions_Tracking.cs (1)
196
private readonly
ImmutableSegmentedDictionary
<SyntaxAnnotation, IReadOnlyList<SyntaxNode>> _idToNodeMap;
Microsoft.CodeAnalysis.CSharp (35)
Binder\Binder_Expressions.cs (1)
5227
var
requiredMembers = constructor.ContainingType.AllRequiredMembers;
Declarations\DeclarationTreeBuilder.cs (16)
132
var
memberNames = GetNonTypeMemberNames(internalMembers, ref declFlags, skipGlobalStatements: acceptSimpleProgram);
141
private static SingleNamespaceOrTypeDeclaration CreateImplicitClass(
ImmutableSegmentedDictionary
<string, VoidResult> memberNames, SyntaxReference container, SingleTypeDeclaration.TypeDeclarationFlags declFlags)
170
memberNames:
ImmutableSegmentedDictionary
<string, VoidResult>.Empty,
208
var
membernames = GetNonTypeMemberNames(((Syntax.InternalSyntax.CompilationUnitSyntax)(compilationUnit.Green)).Members, ref declFlags);
239
ImmutableSegmentedDictionary
<string, VoidResult> memberNames,
623
var
memberNames = GetNonTypeMemberNames(((Syntax.InternalSyntax.TypeDeclarationSyntax)(node.Green)).Members,
731
memberNames:
ImmutableSegmentedDictionary
<string, VoidResult>.Empty,
750
ImmutableSegmentedDictionary
<string, VoidResult> memberNames = GetEnumMemberNames(members, ref declFlags);
789
private static readonly ObjectPool<
ImmutableSegmentedDictionary
<string, VoidResult>.Builder> s_memberNameBuilderPool =
790
new ObjectPool<
ImmutableSegmentedDictionary
<string, VoidResult>.Builder>(() => ImmutableSegmentedDictionary.CreateBuilder<string, VoidResult>());
792
private static
ImmutableSegmentedDictionary
<string, VoidResult> ToImmutableAndFree(
ImmutableSegmentedDictionary
<string, VoidResult>.Builder builder)
794
var
result = builder.ToImmutable();
800
private static
ImmutableSegmentedDictionary
<string, VoidResult> GetEnumMemberNames(SeparatedSyntaxList<EnumMemberDeclarationSyntax> members, ref SingleTypeDeclaration.TypeDeclarationFlags declFlags)
828
private static
ImmutableSegmentedDictionary
<string, VoidResult> GetNonTypeMemberNames(
978
Syntax.InternalSyntax.CSharpSyntaxNode member,
ImmutableSegmentedDictionary
<string, VoidResult>.Builder set, ref bool anyNonTypeMembers, bool skipGlobalStatements)
Declarations\SingleTypeDeclaration.cs (2)
71
ImmutableSegmentedDictionary
<string, VoidResult> memberNames,
120
public
ImmutableSegmentedDictionary
<string, VoidResult> MemberNames { get; }
FlowAnalysis\NullableWalker.cs (2)
999
var
requiredMembers = containingType.BaseTypeNoUseSiteDiagnostics?.AllRequiredMembers ??
ImmutableSegmentedDictionary
<string, Symbol>.Empty;
Symbols\NamedTypeSymbol.cs (12)
29
private static readonly
ImmutableSegmentedDictionary
<string, Symbol> RequiredMembersErrorSentinel =
ImmutableSegmentedDictionary
<string, Symbol>.Empty.Add("<error sentinel>", null!);
32
/// <see langword="default"/> if uninitialized. <see cref="RequiredMembersErrorSentinel"/> if there are errors. <see cref="
ImmutableSegmentedDictionary
{TKey, TValue}.Empty"/> if
35
private
ImmutableSegmentedDictionary
<string, Symbol> _lazyRequiredMembers = default;
559
internal
ImmutableSegmentedDictionary
<string, Symbol> AllRequiredMembers
567
return
ImmutableSegmentedDictionary
<string, Symbol>.Empty;
581
ImmutableSegmentedDictionary
<string, Symbol>.Builder? builder = null;
584
var
requiredMembers = success
585
? builder?.ToImmutable() ??
ImmutableSegmentedDictionary
<string, Symbol>.Empty
594
private bool TryCalculateRequiredMembers(ref
ImmutableSegmentedDictionary
<string, Symbol>.Builder? requiredMembersBuilder)
596
var
lazyRequiredMembers = _lazyRequiredMembers;
615
bool addCurrentTypeMembers(ref
ImmutableSegmentedDictionary
<string, Symbol>.Builder? requiredMembersBuilder)
Symbols\Source\SourceNamespaceSymbol.cs (2)
32
private readonly
ImmutableSegmentedDictionary
<SingleNamespaceDeclaration, AliasesAndUsings> _aliasesAndUsings;
34
private readonly
ImmutableSegmentedDictionary
<SingleNamespaceDeclaration, AliasesAndUsings> _aliasesAndUsingsForAsserts;
Microsoft.CodeAnalysis.UnitTests (55)
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (22)
37
var builder =
ImmutableSegmentedDictionary
<int, string>.Empty.ToBuilder();
45
var
set = builder.ToImmutable();
57
var
set =
ImmutableSegmentedDictionary
<int, string>.Empty.Add(1, "1");
67
var
set2 = builder.ToImmutable();
82
var mutable =
ImmutableSegmentedDictionary
<int, string>.Empty.ToBuilder();
83
var
immutable1 = mutable.ToImmutable();
87
var
immutable2 = mutable.ToImmutable();
96
var builder =
ImmutableSegmentedDictionary
<int, string?>.Empty
126
var
collection =
ImmutableSegmentedDictionary
<int, string?>.Empty.Add(1, null);
131
var
newImmutable = builder.ToImmutable();
172
var
map = ImmutableSegmentedDictionary.Create<string, int>().Add("five", 5);
194
var
set = builder.ToImmutable();
211
var
set = builder.ToImmutable();
230
var
set = builder.ToImmutable();
249
ImmutableSegmentedDictionary
<int, string>.Builder builder = ImmutableSegmentedDictionary.CreateBuilder<int, string>();
269
ImmutableSegmentedDictionary
<int, int>.Builder builder = ImmutableSegmentedDictionary.CreateBuilder<int, int>();
274
var
dictionary = builder.ToImmutableSegmentedDictionary();
287
ImmutableSegmentedDictionary
<int, int>.Builder? nullBuilder = null;
303
return ((
ImmutableSegmentedDictionary
<TKey, TValue>.Builder)dictionary).TryGetKey(equalKey, out actualKey);
308
return ((
ImmutableSegmentedDictionary
<TKey, TValue>)(basis ?? GetEmptyImmutableDictionary<TKey, TValue>())).ToBuilder();
Collections\ImmutableSegmentedDictionaryTest.cs (28)
39
var
map = Empty<string, string>(StringComparer.Ordinal)
45
var
newMap = map.WithComparer(StringComparer.OrdinalIgnoreCase);
54
var
map = Empty<string, string>(StringComparer.Ordinal)
65
var
map = Empty<string, int>().WithComparer(StringComparer.OrdinalIgnoreCase)
74
ContainsValueTestHelper(
ImmutableSegmentedDictionary
<int, GenericParameterHelper>.Empty, 1, new GenericParameterHelper());
80
ImmutableSegmentedDictionary
<int, string?> dictionary = new Dictionary<int, string?>
95
var
dictionary = ImmutableSegmentedDictionary.Create<string, string>();
118
ImmutableSegmentedDictionary
<string, string> dictionary = pairs.ToImmutableSegmentedDictionary();
139
var
intDictionary = list.ToImmutableSegmentedDictionary(n => (double)n);
144
var
stringIntDictionary = list.ToImmutableSegmentedDictionary(n => n.ToString(), StringComparer.OrdinalIgnoreCase);
161
var
dictionary = ImmutableSegmentedDictionary.Create<string, string>();
162
var
result = dictionary.ToImmutableSegmentedDictionary();
173
var
map = ImmutableSegmentedDictionary.Create<string, string>().Add("a", "1").Add("B", "1");
190
var
map = ImmutableSegmentedDictionary.Create<string, string>()
207
var
map = ImmutableSegmentedDictionary.Create<string, string>()
216
var
map = ImmutableSegmentedDictionary.Create<string, string>();
236
var
empty = ImmutableSegmentedDictionary.Create<string, int>();
237
var
populated = ImmutableSegmentedDictionary.Create<string, int>().Add("a", 5);
248
ImmutableSegmentedDictionary
<string, int> dict = ImmutableSegmentedDictionary.Create<string, int>().Add("One", 1).Add("Two", 2);
269
ImmutableSegmentedDictionary
<string, int> dictionary = new Dictionary<string, int>
273
Assert.True(IsSame(
ImmutableSegmentedDictionary
<string, int>.Empty, dictionary.Clear()));
280
ImmutableSegmentedDictionary
<string, int> dictionary = new Dictionary<string, int>
285
ImmutableSegmentedDictionary
<string, int> clearedDictionary = dictionary.Clear();
286
Assert.False(IsSame(
ImmutableSegmentedDictionary
<string, int>.Empty, clearedDictionary.Clear()));
296
var
map = ImmutableSegmentedDictionary.Create<string, string>()
318
private protected static void ContainsValueTestHelper<TKey, TValue>(
ImmutableSegmentedDictionary
<TKey, TValue> map, TKey key, TValue value)
325
private static
ImmutableSegmentedDictionary
<TKey, TValue> Empty<TKey, TValue>(IEqualityComparer<TKey>? keyComparer = null)
328
return
ImmutableSegmentedDictionary
<TKey, TValue>.Empty.WithComparer(keyComparer);
Collections\ImmutableSegmentedDictionaryTest.nonnetstandard.cs (1)
29
var
emptyMap = Empty<int, GenericParameterHelper>(new BadHasher<int>());
Collections\ImmutablesTestBase.cs (2)
96
if (first is
ImmutableSegmentedDictionary
<TKey, TValue> firstSegmented
97
&& second is
ImmutableSegmentedDictionary
<TKey, TValue> secondSegmented)
Collections\TestExtensionsMethods.nonnetstandard.cs (2)
36
ImmutableSegmentedDictionary
<TKey, TValue> d => d.ToBuilder(),
48
ImmutableSegmentedDictionary
<TKey, TValue> d => d.KeyComparer,