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