27 types derived from HashSet
GenerateDocumentationAndConfigFiles (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
illink (1)
ILLink.RoslynAnalyzer (1)
src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (1)
33private sealed class EnumerableValues : HashSet<TValue>
Metrics (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Metrics.Legacy (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Analyzers (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.CodeStyle (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Collections.Package (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Debugging.Package (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Extensions.Package (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.PooledObjects.Package (1)
PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Threading.Package (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Workspaces (2)
FindSymbols\FindReferences\MetadataUnifyingSymbolHashSet.cs (1)
11internal sealed class MetadataUnifyingSymbolHashSet : HashSet<ISymbol>, IPooled
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.DotNet.XUnitAssert.Tests (2)
EqualityAssertsTests.cs (2)
4481 class NonGenericSet : HashSet<string> { } 4483 class TwoGenericSet<T, U> : HashSet<T> { }
Roslyn.Diagnostics.Analyzers (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Test.Utilities (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
Text.Analyzers (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
14internal sealed partial class PooledHashSet<T> : HashSet<T>
2051 instantiations of HashSet
AnalyzerRunner (3)
CodeRefactoringRunner.cs (1)
178var refactoringTypes = new HashSet<Type>();
DiagnosticAnalyzerRunner.cs (2)
209var uniqueLines = new HashSet<string>(); 257var analyzerTypes = new HashSet<Type>();
aspire (1)
Commands\ExecCommand.cs (1)
291var knownOptions = new HashSet<string>(Options.SelectMany(o => o.Aliases));
Aspire.Dashboard (10)
Components\Controls\ResourceDetails.razor.cs (1)
54private readonly HashSet<string> _unmaskedItemNames = new();
Components\Controls\SummaryDetailsView.razor.cs (1)
223public IReadOnlySet<AspireKeyboardShortcut> SubscribedShortcuts { get; } = new HashSet<AspireKeyboardShortcut>
Components\Layout\MainLayout.razor.cs (1)
236public IReadOnlySet<AspireKeyboardShortcut> SubscribedShortcuts { get; } = new HashSet<AspireKeyboardShortcut>
Components\Pages\Resources.razor.cs (1)
99private readonly HashSet<string> _collapsedResourceNames = new(StringComparers.ResourceName);
Components\Pages\TraceDetail.razor.cs (2)
105var visibleViewModels = new HashSet<SpanWaterfallViewModel>(); 231var apps = new HashSet<OtlpApplication>();
Model\DimensionFilterViewModel.cs (1)
16public HashSet<DimensionValueViewModel> SelectedValues { get; } = new();
Otlp\Storage\TelemetryRepository.cs (2)
45private readonly HashSet<(OtlpApplication Application, string PropertyKey)> _logPropertyKeys = new(); 46private readonly HashSet<(OtlpApplication Application, string PropertyKey)> _tracePropertyKeys = new();
Utils\MarkdownHelpers.cs (1)
15private static readonly HashSet<string> s_allowedSchemes = new HashSet<string>(StringComparers.EndpointAnnotationUriScheme) { "http", "https", "mailto" };
Aspire.Hosting (8)
ApplicationModel\EndpointReferenceAnnotation.cs (1)
13public HashSet<string> EndpointNames { get; } = new(StringComparers.EndpointAnnotationName);
Dashboard\DashboardLifecycleHook.cs (2)
42private static readonly HashSet<string> s_suppressAutomaticConfigurationCopy = new HashSet<string>(StringComparer.OrdinalIgnoreCase) 330var corsOrigins = new HashSet<string>(StringComparers.UrlHost);
Dcp\DcpExecutor.cs (1)
837var serviceNames = new HashSet<string>();
Dcp\ResourceSnapshotBuilder.cs (1)
207var serviceEndpoints = new HashSet<(string EndpointName, string ServiceMetadataName)>(resourceServices.Where(s => !string.IsNullOrEmpty(s.EndpointName)).Select(s => (s.EndpointName!, s.Metadata.Name)));
Publishing\ManifestPublishingContext.cs (1)
404var httpSchemesEncountered = new HashSet<string>();
ResourceBuilderExtensions.cs (1)
1984var processed = new HashSet<object>();
ResourceLoggerForwarderService.cs (1)
39var loggingResourceIds = new HashSet<string>();
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
469existingRoles = new HashSet<RoleDefinition>();
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
247var httpSchemesEncountered = new HashSet<string>();
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryExtensions.cs (1)
63.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
40.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.PostgreSQL (1)
AzurePostgresExtensions.cs (1)
145.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.Redis (1)
AzureRedisExtensions.cs (1)
125.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.Sql (1)
AzureSqlExtensions.cs (1)
90.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Docker (3)
DockerComposeServiceResource.cs (3)
21private static readonly HashSet<string> s_shellExecutables = new(StringComparer.OrdinalIgnoreCase) 222var ports = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 223var expose = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Aspire.Hosting.Kubernetes (2)
Extensions\ResourceExtensions.cs (2)
74var processedKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 105var processedKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Aspire.Hosting.Sdk.Tests (2)
src\Aspire.AppHost.Sdk\Aspire.RuntimeIdentifier.Tool\NuGetUtils.cs (2)
32HashSet<string> availableRids = new(availableRuntimeIdentifiers, StringComparer.Ordinal); 33HashSet<string>? excludedRids = runtimeIdentifiersToExclude switch { null => null, _ => new HashSet<string>(runtimeIdentifiersToExclude, StringComparer.Ordinal) };
Aspire.Hosting.Testing.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
127var loggingResourceIds = new HashSet<string>();
Aspire.Hosting.Tests (4)
Dcp\DcpExecutorTests.cs (1)
93var resourceIds = new HashSet<string>();
DistributedApplicationTests.cs (2)
958var expectedExeResources = new HashSet<string>() 967var expectedContainerResources = new HashSet<string>()
Utils\LoggerNotificationExtensions.cs (1)
127var loggingResourceIds = new HashSet<string>();
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientInstrumentation.cs (1)
25private static readonly HashSet<string> DiagnosticSourceEvents = new()
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientInstrumentation.cs (1)
25private static readonly HashSet<string> DiagnosticSourceEvents = new()
Aspire.Playground.Tests (2)
Infrastructure\DistributedApplicationExtensions.cs (1)
57var seenVolumes = new HashSet<string>();
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
127var loggingResourceIds = new HashSet<string>();
Aspire.RuntimeIdentifier.Tool (2)
NuGetUtils.cs (2)
32HashSet<string> availableRids = new(availableRuntimeIdentifiers, StringComparer.Ordinal); 33HashSet<string>? excludedRids = runtimeIdentifiersToExclude switch { null => null, _ => new HashSet<string>(runtimeIdentifiersToExclude, StringComparer.Ordinal) };
Aspire.Templates.Tests (1)
StarterTemplateRunTestsBase.cs (1)
141r => Assert.Contains(r, new HashSet<string> { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }));
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
49_valueTypes = new HashSet<string>();
BuildActionTelemetryTable (1)
Program.cs (1)
26private static ImmutableHashSet<string> IgnoredCodeActions { get; } = new HashSet<string>()
BuildBoss (5)
CompilerNuGetCheckerUtil.cs (4)
238var foundSet = new HashSet<string>(PathComparer); 363var excludedNameSet = new HashSet<string>(PathComparer) 375var foundDllNameSet = new HashSet<string>(PathComparer); 376var neededDllNameSet = new HashSet<string>(PathComparer);
SolutionCheckerUtil.cs (1)
147var set = new HashSet<string>();
BuildValidator (1)
LocalReferenceResolver.cs (1)
40private readonly HashSet<DirectoryInfo> _indexDirectories = new();
CodeGenerator (1)
HttpUtilities\HttpUtilitiesGeneratorHelpers.cs (1)
81var mashHash = new HashSet<ulong>();
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\BindingHelperInfo.cs (1)
211_typesForGen[method] = types = new HashSet<TypeSpec>();
Crossgen2Tasks (3)
CommonFilePulledFromSdkRepo\NuGetUtils.NuGet.cs (1)
88HashSet<string> availableRids = new HashSet<string>(availableRuntimeIdentifiers);
PrepareForReadyToRunCompilation.cs (2)
111var exclusionSet = ExcludeList == null || Crossgen2Composite ? null : new HashSet<string>(ExcludeList, StringComparer.OrdinalIgnoreCase); 112var compositeExclusionSet = PublishReadyToRunCompositeExclusions == null || !Crossgen2Composite ? null : new HashSet<string>(PublishReadyToRunCompositeExclusions, StringComparer.OrdinalIgnoreCase);
CSharpSyntaxGenerator (2)
SourceWriter.cs (2)
1599var factoryWithNoAutoCreatableTokenFields = new HashSet<Field>(DetermineRedFactoryWithNoAutoCreatableTokenFields(nd)); 1682var minimalFactoryfields = new HashSet<Field>(DetermineMinimalFactoryFields(nd));
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
dotnet-svcutil-lib (8)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (3)
1283return IsTypeSerializable(type, new HashSet<Type>()); 1409return GetStableName(type, new HashSet<Type>(), out hasDataContract); 1574return GetCollectionStableName(type, itemType, new HashSet<Type>(), out collectionContractAttribute);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObjectManager.cs (1)
17_table = new HashSet<ItemType>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (1)
18internal static HashSet<string> WellKnownContentHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (1)
35private static readonly HashSet<char> s_InvalidSeparatorSet = new HashSet<char>(new char[] { '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}', ' ' });
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (1)
418private HashSet<IChannel> _hashSet = new HashSet<IChannel>();
ImportModule.cs (1)
406private readonly HashSet<ContractDescription> _httpBindingContracts = new HashSet<ContractDescription>();
dotnet-user-jwts (1)
Helpers\DevJwtCliHelpers.cs (1)
76var applicationUrls = new HashSet<string>();
GenerateDocumentationAndConfigFiles (29)
Program.cs (2)
268var fixableDiagnosticIds = new HashSet<string>(); 269var categories = new HashSet<string>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
illink (48)
ILLink.RoslynAnalyzer (4)
DataFlow\DynamicallyAccessedMembersBinder.cs (1)
415public static void GetAllOnType(this ITypeSymbol type, bool declaredOnly, List<ISymbol> members) => GetAllOnType(type, declaredOnly, members, new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default));
DataFlow\LValueFlowCaptureProvider.cs (1)
61var rvalueFlowCaptureIds = new HashSet<CaptureId>();
ISymbolExtensions.cs (1)
86HashSet<string> featureSet = new();
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
80var values = new HashSet<DynamicallyAccessedMemberTypes>(
ILLink.Tasks (4)
CreateRuntimeRootDescriptorFile.cs (3)
98readonly HashSet<string> defineConstants = new HashSet<string>(StringComparer.Ordinal); 490members.fields ??= new HashSet<string>(); 517members.methods ??= new HashSet<string>();
LinkTask.cs (1)
360HashSet<string> assemblyNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Infrastructure.Common (2)
xunit\IssueAttribute.cs (2)
111return propertyAsBool ? new HashSet<int>() : null; 117HashSet<int> hashSet = new HashSet<int>();
InMemory.FunctionalTests (1)
Http2\Http2TestBase.cs (1)
133protected readonly HashSet<int> _abortedStreamIds = new HashSet<int>();
installer.tasks (2)
FileUtilities.cs (1)
14private static readonly HashSet<string> s_assemblyExtensions = new HashSet<string>(
GenerateTestSharedFrameworkDepsFile.cs (1)
45var ignoredExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Interop.FunctionalTests (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
40_blocks = new HashSet<DiagnosticPoolBlock>();
InteropTests (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
IOperationGenerator (2)
IOperationClassWriter.cs (2)
493var newProps = new HashSet<string>(StringComparer.Ordinal); 961var newProps = new HashSet<string>(StringComparer.Ordinal);
KeyManagementSimulator (1)
Program.cs (1)
394_knownKeyIds = new(((KeyRing)keyRing.KeyRing).GetAllKeyIds());
Metrics (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Metrics.Legacy (23)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Microsoft.Analyzers.Extra (3)
AsyncMethodWithoutCancellation.cs (1)
49var knownTypes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
MakeExeTypesInternalAnalyzer.cs (2)
59var disqualifyingMemberAttributes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 69var disqualifyingTypeAttributes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
Microsoft.Analyzers.Extra.Tests (3)
SyntaxNodeExtensionsTests.cs (3)
88var typesToStopTraversing = new HashSet<Type> 150Assert.False(methodInvocSyntax!.NodeHasSpecifiedMethod(model, new HashSet<string>())); 180Assert.True(methodInvocSyntax!.NodeHasSpecifiedMethod(model, new HashSet<string> { "Extensions.AddA(string)" }));
Microsoft.Analyzers.Local (3)
ApiLifecycle\AssemblyAnalysis.cs (3)
23public HashSet<ISymbol> NotFoundInBaseline { get; } = new(SymbolEqualityComparer.Default); 141var baseTypes = new HashSet<string>(type.AllInterfaces.Select(x => x.ToDisplayString(_shortSymbolNameFormat))); 176var constraints = new HashSet<string>(Utils.GetConstraints(typeSignature));
Microsoft.Arcade.Test.Common (3)
AssertEx.cs (2)
244var expectedSet = new HashSet<T>(expected, comparer); 259var expectedSet = new HashSet<T>(expected);
MockFileSystem.cs (1)
31Directories = new(directories ?? new string[0]);
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticVerifier.cs (1)
73var projects = new HashSet<Project>();
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
20var seen = new HashSet<string>();
Microsoft.AspNetCore.App.Analyzers (4)
Infrastructure\RoutePattern\RoutePatternParser.cs (1)
71var seenDiagnostics = new HashSet<EmbeddedDiagnostic>();
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
480private readonly HashSet<string> _names = new(StringComparer.OrdinalIgnoreCase);
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
71var routeParameterNames = new HashSet<string>(routeUsage.RoutePattern.RouteParameters.Select(p => p.Name), StringComparer.OrdinalIgnoreCase);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
328private readonly HashSet<string> _names = new();
Microsoft.AspNetCore.App.UnitTests (1)
TargetingPackTests.cs (1)
311new HashSet<string>();
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookOptions.cs (1)
93public ICollection<string> Fields { get; } = new HashSet<string>();
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\LdapAdapter.cs (1)
73GetNestedGroups(settings.LdapConnection, identity, distinguishedName, groupCN, logger, retrievedClaims, new HashSet<string>());
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthOptions.cs (1)
84public ICollection<string> Scope { get; } = new HashSet<string>();
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectOptions.cs (1)
237public ICollection<string> Scope { get; } = new HashSet<string>();
Microsoft.AspNetCore.Authorization (1)
AuthorizationHandlerContext.cs (1)
38_pendingRequirements = new HashSet<IAuthorizationRequirement>(requirements);
Microsoft.AspNetCore.BrowserTesting (2)
BrowserManagerConfiguration.cs (2)
32new HashSet<string>(StringComparer.OrdinalIgnoreCase); 288argValue = new HashSet<string>();
Microsoft.AspNetCore.Components (11)
CascadingValue.cs (1)
157_subscribers ??= new HashSet<ComponentState>();
NavigationManager.cs (1)
411var locationChangingTasks = new HashSet<Task>();
ResourceAssetCollection.cs (1)
30var contentSpecificUrls = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Routing\RouteKey.cs (1)
16AdditionalAssemblies = additionalAssemblies is null ? null : new HashSet<Assembly>(additionalAssemblies);
Routing\RouteTableFactory.cs (3)
166public HashSet<string> AllRouteParameterNames { get; set; } = new(StringComparer.OrdinalIgnoreCase); 202var seen = new HashSet<InboundRouteEntry>(new InboundRouteEntryAmbiguityEqualityComparer()); 226var parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Routing\SupplyParameterFromQueryValueProvider.cs (2)
41_pendingSubscribers ??= new(); 46_subscribers ??= new();
src\Http\Routing\src\Patterns\RoutePatternParser.cs (1)
481private readonly HashSet<string> _parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
src\Http\Routing\src\RouteConstraintBuilder.cs (1)
45_optionalParameters = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
53var projects = new HashSet<Project>();
Microsoft.AspNetCore.Components.Authorization.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.Endpoints (5)
Builder\RazorComponentDataSourceOptions.cs (1)
33internal ISet<IComponentRenderMode> ConfiguredRenderModes { get; } = new HashSet<IComponentRenderMode>(RenderModeComparer);
Discovery\ComponentApplicationBuilder.cs (1)
14private readonly HashSet<string> _assemblies = new();
Discovery\RazorComponentApplication.cs (1)
39var set = new HashSet<IComponentRenderMode>();
FormMapping\FormDataReader.cs (1)
155result.Add(new FormKey(prefix), new HashSet<FormKey> { new FormKey(keyValue) });
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
145_visitedComponentIdsInCurrentStreamingBatch = new();
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
Binding\FormDataMapperTests.cs (3)
657var expected = new HashSet<int> { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; 681var expected = new HashSet<int> { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; 729var expected = new HashSet<int> { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
ImportMapTest.cs (1)
277private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.Forms (1)
FieldState.cs (1)
41_validationMessageStores = new HashSet<ValidationMessageStore>();
Microsoft.AspNetCore.Components.Forms.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
53var projects = new HashSet<Project>();
Microsoft.AspNetCore.Components.Server (2)
Circuits\ServerComponentDeserializer.cs (2)
68private readonly HashSet<Guid> _expiredInvocationIds = new(); 69private readonly HashSet<int> _seenSequenceNumbersForCurrentInvocation = new();
Microsoft.AspNetCore.Components.Tests (4)
NavigationManagerTest.cs (2)
566var canceledHandlerTaskIds = new HashSet<string>(); 610var canceledHandlerTaskIds = new HashSet<string>();
Routing\RouteTableFactoryTests.cs (1)
127var result = new HashSet<InboundRouteEntry>();
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.Web (1)
HtmlRendering\StaticHtmlRenderer.HtmlWriting.cs (1)
14private static readonly HashSet<string> SelfClosingElements = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.Components.Web.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.WebAssembly (2)
.packages\microsoft.dotnet.hotreload.agent\10.0.100-preview.7.25358.102\contentFiles\cs\net6.0\MetadataUpdateHandlerInvoker.cs (1)
323var visited = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Hosting\WebAssemblyHostConfiguration.cs (1)
94var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Components.WebView (2)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
79files ??= new(_nameComparer); 102files ??= new(_nameComparer);
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\XmlKeyManager.cs (2)
437var allKeyIds = new HashSet<Guid>(); 438var deletedKeyIds = new HashSet<Guid>();
Microsoft.AspNetCore.DataProtection.Tests (3)
Repositories\EphemeralXmlRepositoryTests.cs (1)
78var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Repositories\FileSystemXmlRepositoryTests.cs (1)
183var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Repositories\RegistryXmlRepositoryTests.cs (1)
171var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\LoggingRedactionOptions.cs (1)
101public ISet<string> ExcludePathStartsWith { get; set; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\IncomingHttpDimensionsTests.cs (1)
19var names = new HashSet<string>(dimensions);
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\GrpcProtocolConstants.cs (1)
15internal static readonly HashSet<string> FilteredHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
src\Grpc\JsonTranscoding\src\Shared\DescriptorRegistry.cs (1)
13private readonly HashSet<FileDescriptor> _fileDescriptors = new HashSet<FileDescriptor>();
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
35private static readonly HashSet<string> WellKnownTypeNames = new HashSet<string>
Microsoft.AspNetCore.Grpc.Swagger (2)
src\Grpc\JsonTranscoding\src\Shared\DescriptorRegistry.cs (1)
13private readonly HashSet<FileDescriptor> _fileDescriptors = new HashSet<FileDescriptor>();
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
35private static readonly HashSet<string> WellKnownTypeNames = new HashSet<string>
Microsoft.AspNetCore.Hosting (5)
GenericHost\GenericWebHostBuilder.cs (1)
130var processed = new HashSet<Assembly>();
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
79files ??= new(_nameComparer); 102files ??= new(_nameComparer);
WebHostBuilder.cs (2)
179var assemblyNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 225var processed = new HashSet<Assembly>();
Microsoft.AspNetCore.Http.Extensions (1)
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (1)
155result.Add(new FormKey(prefix), new HashSet<FormKey> { new FormKey(keyValue) });
Microsoft.AspNetCore.Http.Results.Tests (2)
ResultsTests.cs (2)
1709var testedMethods = new HashSet<string>(FactoryMethodsTuples.Select(t => GetMemberName(t.Item1.Body))); 1710var actualMethods = new HashSet<string>(typeof(Results).GetMethods(BindingFlags.Public | BindingFlags.Static)
Microsoft.AspNetCore.HttpLogging (2)
HttpLoggingOptions.cs (2)
32internal HashSet<string> _internalRequestHeaders = new HashSet<string>(26, StringComparer.OrdinalIgnoreCase) 71internal HashSet<string> _internalResponseHeaders = new HashSet<string>(19, StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.InternalTesting (1)
Tracing\CollectingEventListener.cs (1)
18private readonly HashSet<string> _requestedEventSources = new HashSet<string>();
Microsoft.AspNetCore.Mvc.Analyzers (1)
TagHelpersInCodeBlocksAnalyzer.cs (1)
43var capturedDiagnosticLocations = new HashSet<Location>();
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
116var declaredUsings = new HashSet<string>(compilationUnit.Usings.Select(x => x.Name.ToString()));
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
559Visited = new HashSet<PropertyKey>(new PropertyKeyEqualityComparer());
Microsoft.AspNetCore.Mvc.Core (9)
ApplicationModels\ControllerActionDescriptorProvider.cs (1)
52var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ApplicationParts\ApplicationPartManager.cs (1)
55var seenAssemblies = new HashSet<Assembly>();
ModelBinding\FormValueProvider.cs (1)
39_invariantValueKeys = new(invariantKeys, StringComparer.OrdinalIgnoreCase);
ModelBinding\JQueryFormValueProvider.cs (1)
32_invariantValueKeys = new(invariantKeys, StringComparer.OrdinalIgnoreCase);
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
448var visited = new HashSet<DefaultModelMetadata>();
ModelBinding\Validation\ValidationStack.cs (1)
40HashSet = new HashSet<object>(List, ReferenceEqualityComparer.Instance);
Routing\ControllerActionEndpointDataSource.cs (2)
74var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 79var routeNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Routing\KnownRouteValueConstraint.cs (1)
98var values = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Mvc.Core.Test (25)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (19)
997var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1015var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1031var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1045var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1059var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1084var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1111var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1135var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1162var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1203var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1246var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1275var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1318var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1363var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1404var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1454var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1499var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1544var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata); 1587var result = DefaultModelMetadata.CalculateHasValidators(new HashSet<DefaultModelMetadata>(), modelMetadata);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (2)
876{ new HashSet<string> { "Foo", "Bar", "Baz" }, typeof(string[]) }, 887new HashSet<Uri>
Routing\ActionEndpointFactoryTest.cs (4)
275new HashSet<string>(), 381new HashSet<string>(), 404new HashSet<string>(), 430new HashSet<string>(),
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
ModelMetadataProviderTest.cs (1)
34var matched = new HashSet<string>();
Microsoft.AspNetCore.Mvc.Razor (4)
RazorPage.cs (2)
15private readonly HashSet<string> _renderedSections = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 200_ignoredSections = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
RazorViewEngine.cs (2)
191var expirationTokens = new HashSet<IChangeToken>(); 353var expirationTokens = new HashSet<IChangeToken>();
Microsoft.AspNetCore.Mvc.Razor.Test (2)
RazorViewTest.cs (2)
1750var expected = new HashSet<IRazorPage>(); 1753var activated = new HashSet<IRazorPage>();
Microsoft.AspNetCore.Mvc.RazorPages (3)
ApplicationModels\CompiledPageRouteModelProvider.cs (1)
54var visited = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Infrastructure\DefaultPageLoader.cs (1)
68routeNames: new HashSet<string>(StringComparer.OrdinalIgnoreCase),
Infrastructure\PageActionEndpointDataSource.cs (1)
53var routeNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
OptionTagHelper.cs (1)
93var allValues = new HashSet<string>(currentValues.Values, StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (21)
OptionTagHelperTest.cs (21)
52null, null, "value", new HashSet<string>(), 62null, null, "value", new HashSet<string>(new [] { string.Empty, }), 72null, string.Empty, "value", new HashSet<string>(new [] { string.Empty, }), 82null, null, "value", new HashSet<string>(new [] { "value", }), 92null, null, "value", new HashSet<string>(new [] { string.Empty, "value", }), 132string.Empty, null, null, new HashSet<string>(), 142string.Empty, null, null, new HashSet<string>(new [] { string.Empty, }), 153new HashSet<string>(new [] { string.Empty, }), 163string.Empty, null, null, new HashSet<string>(new [] { "text", }), 174new HashSet<string>(new [] { string.Empty, "text", }), 214"text", null, null, new HashSet<string>(), 224"text", null, null, new HashSet<string>(new [] { string.Empty, }), 234"HtmlEncode[[text]]", null, null, new HashSet<string>(new [] { "text", }), 244"text", string.Empty, null, new HashSet<string>(new [] { "text", }), 255new HashSet<string>(new [] { string.Empty, "text", }), 285"text", null, "value", new HashSet<string>(), 295"text", null, "value", new HashSet<string>(new [] { string.Empty, }), 306new HashSet<string>(new [] { string.Empty, }), 316"text", null, "value", new HashSet<string>(new [] { "text", }), 326"text", null, "value", new HashSet<string>(new [] { "value", }), 337new HashSet<string>(new [] { string.Empty, "value", }),
Microsoft.AspNetCore.Mvc.ViewFeatures (7)
DefaultHtmlGenerator.cs (1)
971var currentValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Rendering\MultiSelectList.cs (2)
150var selectedValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 180var selectedValues = new HashSet<object>();
TempDataDictionary.cs (2)
143_initialKeys = new HashSet<string>(_data.Keys, StringComparer.OrdinalIgnoreCase); 144_retainedKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
TemplateInfo.cs (2)
24_visitedObjects = new HashSet<object>(); 35_visitedObjects = new HashSet<object>(original._visitedObjects);
Microsoft.AspNetCore.OpenApi (8)
Services\OpenApiDocumentService.cs (5)
343document.Tags ??= new HashSet<OpenApiTag>(); 353document.Tags ??= new HashSet<OpenApiTag>(); 574schema.Required ??= new HashSet<string>(); 616schema.Required ??= new HashSet<string>(); 640schema.Required ??= new HashSet<string>();
Services\OpenApiGenerator.cs (3)
331var tags = new HashSet<OpenApiTagReference>(); 337document.Tags ??= new HashSet<OpenApiTag>(); 359document.Tags ??= new HashSet<OpenApiTag>();
Microsoft.AspNetCore.OpenApi.SourceGenerators (3)
Helpers\AssemblyTypeSymbolsVisitor.cs (3)
18private readonly HashSet<INamedTypeSymbol> _exportedTypes = new(SymbolEqualityComparer.Default); 19private readonly HashSet<IPropertySymbol> _exportedProperties = new(SymbolEqualityComparer.Default); 20private readonly HashSet<IMethodSymbol> _exportedMethods = new(SymbolEqualityComparer.Default);
Microsoft.AspNetCore.OpenApi.Tests (1)
Transformers\CustomSchemaTransformerTests.cs (1)
321schema.Required ??= new HashSet<string>();
Microsoft.AspNetCore.OutputCaching (2)
Memory\MemoryOutputCacheStore.cs (1)
96keys = new HashSet<TaggedEntry>();
OutputCacheContext.cs (1)
58public HashSet<string> Tags { get; } = new();
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
29private static readonly HashSet<string> _tags = new();
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCacheEntryFormatterTests.cs (1)
54await OutputCacheEntryFormatter.StoreAsync(key, entry, new HashSet<string>() { "tag", "タグ" }, TimeSpan.Zero, store, NullLogger.Instance, default);
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
558_deletedKeys ??= new HashSet<string>(StringComparer.Ordinal);
Microsoft.AspNetCore.RateLimiting (1)
DefaultCombinedLease.cs (1)
28_metadataNames = new HashSet<string>();
Microsoft.AspNetCore.ResponseCompression (3)
ResponseCompressionProvider.cs (3)
62_mimeTypes = new HashSet<string>(mimeTypes, StringComparer.OrdinalIgnoreCase); 64_excludedMimeTypes = new HashSet<string>( 94var candidates = new HashSet<ProviderCandidate>();
Microsoft.AspNetCore.Routing (8)
DecisionTree\DecisionTreeBuilder.cs (4)
200CurrentCriteria = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 201MatchedItems = new HashSet<ItemDescriptor<TItem>>(); 206CurrentCriteria = new HashSet<string>(other.CurrentCriteria, StringComparer.OrdinalIgnoreCase); 207MatchedItems = new HashSet<ItemDescriptor<TItem>>();
Matching\HttpMethodMatcherPolicy.cs (1)
133methods = methods ?? new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Patterns\RoutePatternFactory.cs (1)
1073var parameterNameSet = new HashSet<string>(parameterCount, StringComparer.OrdinalIgnoreCase);
Patterns\RoutePatternParser.cs (1)
481private readonly HashSet<string> _parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
RouteConstraintBuilder.cs (1)
45_optionalParameters = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Server.HttpSys (2)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
40_blocks = new HashSet<DiagnosticPoolBlock>();
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
19internal static readonly HashSet<string> DisallowedTrailers = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
40_blocks = new HashSet<DiagnosticPoolBlock>();
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
19internal static readonly HashSet<string> DisallowedTrailers = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Microsoft.AspNetCore.Server.Kestrel.Core (6)
Internal\CertificatePathWatcher.cs (3)
75var addSet = new HashSet<CertificateConfig>(certificateConfigsToAdd, ReferenceEqualityComparer.Instance); 76var removeSet = new HashSet<CertificateConfig>(certificateConfigsToRemove, ReferenceEqualityComparer.Instance); 300public readonly HashSet<CertificateConfig> Configs = new(ReferenceEqualityComparer.Instance);
Internal\Http\HttpHeaders.Generated.cs (1)
282private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>(91, StringComparer.OrdinalIgnoreCase)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
40_blocks = new HashSet<DiagnosticPoolBlock>();
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
40_blocks = new HashSet<DiagnosticPoolBlock>();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
40_blocks = new HashSet<DiagnosticPoolBlock>();
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
19internal static readonly HashSet<string> DisallowedTrailers = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.SignalR.Core (1)
HubConnectionContext.cs (1)
60internal HashSet<string> GroupNames { get; } = new HashSet<string>();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
RedisHubLifetimeManager.cs (1)
861public HashSet<string> Groups { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.SignalR.Tests (3)
HubConnectionHandlerTests.cs (3)
1565var excludeSecondClientId = new HashSet<string>(); 1567var excludeThirdClientId = new HashSet<string>(); 1611var secondAndThirdClients = new HashSet<string> {secondClient.Connection.ConnectionId,
Microsoft.AspNetCore.SpaServices.Extensions (3)
Proxying\SpaProxy.cs (3)
22private static readonly HashSet<string> NotForwardedHttpHeaders = new HashSet<string>( 29private static readonly HashSet<string> NotForwardedWebSocketHeaders = new HashSet<string>( 35private static readonly HashSet<string> InvalidH2H3Headers = new HashSet<string>(
Microsoft.Build.Framework (5)
BinaryTranslator.cs (1)
306set = new HashSet<string>(count);
BuildCheck\BuildCheckRuleTelemetryData.cs (2)
59new HashSet<DiagnosticSeverity>(data1.ExplicitSeverities.Union(data2.ExplicitSeverities)), 60new HashSet<string>(data1.ProjectNamesWhereEnabled.Union(data2.ProjectNamesWhereEnabled)),
BuildCheck\EnumerableExtensions.cs (2)
48return new HashSet<T>(capacity, equalityComparer); 64return new HashSet<T>(source, equalityComparer);
Microsoft.Cci.Extensions (24)
Experimental\APIClosureTypeReferenceVisitor.cs (2)
22_typeReferences = new HashSet<ITypeReference>(); 23_assemblyReferences = new HashSet<IAssemblyReference>(new AssemblyReferenceComparer());
Experimental\TypeReferenceSearcher.cs (1)
61_dependencies = new HashSet<TypeReferenceDependency>(new TypeReferenceDependency.TypeReferenceDependencyComparer());
Experimental\TypeReferenceVisitor.cs (2)
22_typeReferences = new HashSet<ITypeReference>(); 23_assemblyReferences = new HashSet<IAssemblyReference>(new AssemblyReferenceComparer());
Extensions\CSharp\CSharpCciExtensions.cs (2)
140HashSet<ITypeReference> visited = new HashSet<ITypeReference>(); 176HashSet<ITypeReference> visited = new HashSet<ITypeReference>();
Filters\DocIdExcludeListFilter.cs (2)
21_docIds = new HashSet<string>(docIds); 27_docIds = new HashSet<string>(DocIdExtensions.ReadDocIds(excludeListFilePath));
Filters\DocIdIncludeListFilter.cs (2)
19_docIds = new HashSet<string>(docIds); 24_docIds = new HashSet<string>(DocIdExtensions.ReadDocIds(includeListFilePath));
Filters\ExcludeAttributesFilter.cs (2)
15_attributeDocIds = new HashSet<string>(attributeDocIds); 20_attributeDocIds = new HashSet<string>(DocIdExtensions.ReadDocIds(attributeDocIdFile));
HostEnvironment.cs (3)
49_unresolvedIdentities = new HashSet<UnresolvedReference<IUnit, AssemblyIdentity>>(); 247HashSet<AssemblyIdentity> consideredIdentities = new HashSet<AssemblyIdentity>(); 689HashSet<string> allPaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Traversers\AssemblyReferenceTraverser.cs (2)
16private HashSet<AssemblyIdentity> _usedAssemblyReferences = new HashSet<AssemblyIdentity>(); 56private HashSet<AssemblyIdentity> _aliasedAssemblyReferences = new HashSet<AssemblyIdentity>();
Traversers\DependencyTraverser.cs (2)
25_unresolvedDependencies = new HashSet<IReference>(new ReferenceEqualityComparer<IReference>()); 200depends = new HashSet<IReference>(new ReferenceEqualityComparer<IReference>());
Traversers\ResolveAllReferencesTraverser.cs (1)
113dependents = new HashSet<IReference>(new ReferenceEqualityComparer());
TypeDependencies.cs (3)
23_publicDependents = new HashSet<ITypeReference>(); 24_dependents = new HashSet<ITypeReference>(); 25_methodDependents = new HashSet<IMethodReference>();
Microsoft.CodeAnalysis (52)
AssemblyUtilities.cs (2)
65HashSet<AssemblyIdentity> assemblyDefinitions = new HashSet<AssemblyIdentity>(); 77HashSet<AssemblyIdentity> assemblyReferences = new HashSet<AssemblyIdentity>();
Binding\AbstractLookupSymbolsInfo.cs (1)
180hashSet = new HashSet<int>();
Binding\BindingDiagnosticBag.cs (1)
72: this(usePool ? DiagnosticBag.GetInstance() : new DiagnosticBag(), usePool ? PooledHashSet<TAssemblySymbol>.GetInstance() : new HashSet<TAssemblySymbol>())
Binding\UseSiteInfo.cs (8)
269_diagnostics ??= new HashSet<DiagnosticInfo>(); 297_diagnostics ??= new HashSet<DiagnosticInfo>(); 315_diagnostics ??= new HashSet<DiagnosticInfo>(); 331_diagnostics ??= new HashSet<DiagnosticInfo>(); 347(_dependencies ??= new HashSet<TAssemblySymbol>()).AddAll(info.SecondaryDependencies); 366(_dependencies ??= new HashSet<TAssemblySymbol>()).AddAll(dependencies); 375(_dependencies ??= new HashSet<TAssemblySymbol>()).AddAll(dependencies); 384(_dependencies ??= new HashSet<TAssemblySymbol>()).AddAll(dependencies);
Collections\HashSetExtensions.cs (1)
27hashSet = new HashSet<T>();
Collections\IdentifierCollection.cs (1)
73_map[identifier] = new HashSet<string> { identifier, strValue };
Collections\OrderedSet.cs (1)
18_set = new HashSet<T>();
CommandLine\CommonCompiler.cs (3)
93private readonly HashSet<Diagnostic> _reportedDiagnostics = new HashSet<Diagnostic>(); 500var set = new HashSet<string>(arguments.EmbeddedFiles.Select(f => f.Path)); 1601var filePaths = new HashSet<string>(PathUtilities.Comparer);
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (1)
37_lazyAvailableReferences = new Lazy<HashSet<AssemblyIdentity>>(() => new HashSet<AssemblyIdentity>(
CommandLine\SarifV2ErrorLogger.cs (1)
39_diagnosticIdsWithAnySourceSuppressions = new HashSet<string>();
Compilation\Compilation.cs (3)
836var refSet = new HashSet<MetadataReference>(this.ExternalReferences); 2137var uniqueResourceNames = new HashSet<string>(); 2141var uniqueFileNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
DiagnosticAnalyzer\AnalysisResultBuilder.cs (2)
45_completedAnalyzersForCompilation = new HashSet<DiagnosticAnalyzer>(); 132var completedAnalyzers = new HashSet<DiagnosticAnalyzer> { analyzer };
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
185set = new(OriginalPathComparer);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2896descendantDeclsToSkip ??= new HashSet<SyntaxNode>();
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (1)
204memberSet ??= new HashSet<ISymbol>();
Emit\CommonPEModuleBuilder.cs (1)
728names = new HashSet<string>();
Emit\EditAndContinue\SymbolChanges.cs (1)
376(lazyReplacedSymbolsBuilder ??= new HashSet<ISymbolInternal>()).Add(GetRequiredInternalSymbol(edit.NewSymbol));
InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
MetadataReader\MetadataDecoder.cs (2)
1984HashSet<TypeDefinitionHandle> visitedTypeDefTokens = new HashSet<TypeDefinitionHandle>(); 1985HashSet<TypeSymbol> visitedTypeSymbols = new HashSet<TypeSymbol>();
MetadataReader\PEModule.cs (1)
416HashSet<EntityHandle> nameTokens = new HashSet<EntityHandle>();
Operations\ControlFlowGraphBuilder.cs (1)
8073var set = new HashSet<IPropertySymbol>(SymbolEqualityComparer.IgnoreAll);
PEWriter\ReferenceIndexer.cs (1)
18private readonly HashSet<IImportScope> _alreadySeenScopes = new HashSet<IImportScope>();
PEWriter\ReferenceIndexerBase.cs (2)
18private readonly HashSet<IReferenceOrISignature> _alreadySeen = new(); 19private readonly HashSet<IReferenceOrISignature> _alreadyHasToken = new();
RuleSet\RuleSet.cs (1)
257return ruleSet.GetEffectiveRuleSet(new HashSet<string>());
SourceGeneration\Nodes\GeneratorRunStateTable.cs (1)
98stepsByName = new HashSet<IncrementalGeneratorRunStep>();
SourceGeneration\Nodes\InputNode.cs (1)
51var itemsSet = (_inputComparer == EqualityComparer<T>.Default) ? PooledHashSet<T>.GetInstance() : new HashSet<T>(_inputComparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
Syntax\SyntaxDiffer.cs (2)
25private readonly HashSet<GreenNode> _nodeSimilaritySet = new HashSet<GreenNode>(); 26private readonly HashSet<string> _tokenTextSimilaritySet = new HashSet<string>();
Text\CompositeText.cs (1)
364= new ObjectPool<HashSet<SourceText>>(() => new HashSet<SourceText>(), 5);
Microsoft.CodeAnalysis.Analyzers (30)
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
117var processedTypes = new HashSet<INamedTypeSymbol>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
281_returnValueOperations = OwningSymbol is IMethodSymbol method && !method.ReturnsVoid ? new HashSet<IOperation>() : null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Microsoft.CodeAnalysis.BannedApiAnalyzers (29)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.CodeStyle (21)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 136private readonly HashSet<IPropertySymbol> _propertiesWithShadowGetAccessorUsages = new(OriginalDefinitionSymbolEqualityComparer.Instance);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
56private readonly ObjectPool<HashSet<string>> _fieldNamesPool = new(() => new(semanticFacts.SyntaxFacts.StringComparer));
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Microsoft.CodeAnalysis.CodeStyle.Fixes (11)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
440var methodParameterNames = new HashSet<string>(comparer);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
23protected static readonly ISet<TypeKind> EnumType = new HashSet<TypeKind> { TypeKind.Enum }; 24protected static readonly ISet<TypeKind> ClassInterfaceModuleStructTypes = new HashSet<TypeKind>
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
46var declarators = new HashSet<SyntaxNode>(); 47var fieldDeclarators = new HashSet<TFieldDeclarationSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.Collections.Package (8)
Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
Microsoft.CodeAnalysis.CSharp (88)
Binder\Binder_Attributes.cs (1)
496boundNamedArgumentsSet = new HashSet<string>();
Binder\Binder_Lookup.cs (4)
981var allMembers = new HashSet<Symbol>(comparer); 982var conflictingMembers = new HashSet<Symbol>(comparer); 1161var visited = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.ConsiderEverything); 1221seenInterfaces = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.IgnoringNullable);
Binder\Binder_Operators.cs (2)
3640var existing = new HashSet<MethodSymbol>(PairedOperatorComparer.Instance); 3706var existing = new HashSet<MethodSymbol>(OverloadResolution.PairedExtensionOperatorSignatureComparer.Instance);
Binder\BindingDiagnosticBag.cs (2)
15private static readonly ObjectPool<BindingDiagnosticBag> s_poolWithBoth = new ObjectPool<BindingDiagnosticBag>(() => new BindingDiagnosticBag(s_poolWithBoth!, new DiagnosticBag(), new HashSet<AssemblySymbol>())); 17private static readonly ObjectPool<BindingDiagnosticBag> s_poolWithDependenciesOnly = new ObjectPool<BindingDiagnosticBag>(() => new BindingDiagnosticBag(s_poolWithDependenciesOnly!, diagnosticBag: null, new HashSet<AssemblySymbol>()));
Binder\RefSafetyAnalysis.cs (1)
68private HashSet<BoundExpression>? _visited = new HashSet<BoundExpression>();
Binder\Semantics\BestTypeInferrer.cs (1)
69HashSet<TypeSymbol> candidateTypes = new HashSet<TypeSymbol>(comparer);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
1472var existing = new HashSet<MethodSymbol>(PairedExtensionOperatorSignatureComparer.Instance);
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (1)
121var existing = new HashSet<MethodSymbol>(PairedExtensionOperatorSignatureComparer.Instance);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
544collectedBounds[methodTypeParameterIndex] = new HashSet<TypeWithAnnotations>(TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer);
CodeGen\Optimizer.cs (1)
78stackLocals = new HashSet<LocalSymbol>(locals.Keys);
CommandLine\CSharpCompiler.cs (1)
99var uniqueFilePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Compilation\CSharpCompilation.cs (3)
2641if (_lazyCompilationUnitCompletedTrees == null) Interlocked.CompareExchange(ref _lazyCompilationUnitCompletedTrees, new HashSet<SyntaxTree>(), null); 2995var parseOptionsReported = new HashSet<ParseOptions>(); 4910var result = new HashSet<Symbol>();
Compilation\CSharpSemanticModel.cs (1)
4215HashSet<Symbol> hiddenSymbols = new HashSet<Symbol>();
Compiler\DocumentationCommentCompiler.cs (2)
1177documentedParameters = new HashSet<ParameterSymbol>(); 1184documentedTypeParameters = new HashSet<TypeParameterSymbol>();
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
450_inProgressIncludeElementNodes = new HashSet<Location>();
Declarations\DeclarationTable.cs (1)
216var set = new HashSet<string>();
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
991seen = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.CLRSignature);
Emitter\Model\PEModuleBuilder.cs (1)
657var seenTopLevelForwardedTypes = new HashSet<NamedTypeSymbol>();
FlowAnalysis\AlwaysAssignedWalker.cs (1)
26private readonly HashSet<LabelSymbol> _labelsInside = new HashSet<LabelSymbol>();
FlowAnalysis\CSharpDataFlowAnalysis.cs (2)
84: new HashSet<Symbol>(); 365: new HashSet<PrefixUnaryExpressionSyntax>();
FlowAnalysis\DataFlowsInWalker.cs (2)
25private readonly HashSet<Symbol> _dataFlowsIn = new HashSet<Symbol>(); 42return badRegion ? new HashSet<Symbol>() : result;
FlowAnalysis\DataFlowsOutWalker.cs (3)
46return badRegion ? new HashSet<Symbol>() : result; 54private readonly HashSet<Symbol> _dataFlowsOut = new HashSet<Symbol>(); 58private readonly HashSet<Symbol> _assignedInside = new HashSet<Symbol>();
FlowAnalysis\DefiniteAssignment.cs (1)
593HashSet<Diagnostic> compatDiagnosticSet = new HashSet<Diagnostic>(compatDiagnostics.AsEnumerable(), SameDiagnosticComparer.Instance);
FlowAnalysis\DefinitelyAssignedWalker.cs (4)
23private readonly HashSet<Symbol> _definitelyAssignedOnEntry = new HashSet<Symbol>(); 24private readonly HashSet<Symbol> _definitelyAssignedOnExit = new HashSet<Symbol>(); 45? (new HashSet<Symbol>(), new HashSet<Symbol>())
FlowAnalysis\EntryPointsWalker.cs (1)
41private readonly HashSet<LabeledStatementSyntax> _entryPoints = new HashSet<LabeledStatementSyntax>();
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
23private readonly HashSet<BoundExpression> _visitedExpressions = new HashSet<BoundExpression>();
FlowAnalysis\ReadWriteWalker.cs (4)
65private readonly HashSet<Symbol> _readInside = new HashSet<Symbol>(); 66private readonly HashSet<Symbol> _writtenInside = new HashSet<Symbol>(); 67private readonly HashSet<Symbol> _readOutside = new HashSet<Symbol>(); 68private readonly HashSet<Symbol> _writtenOutside = new HashSet<Symbol>();
FlowAnalysis\UnassignedAddressTakenVariablesWalker.cs (1)
39private readonly HashSet<PrefixUnaryExpressionSyntax> _result = new HashSet<PrefixUnaryExpressionSyntax>();
FlowAnalysis\UnassignedVariablesWalker.cs (2)
40return badRegion ? new HashSet<Symbol>() : result; 48private readonly HashSet<Symbol> _result = new HashSet<Symbol>();
FlowAnalysis\VariablesDeclaredWalker.cs (1)
38private HashSet<Symbol> _variablesDeclared = new HashSet<Symbol>();
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (1)
859_awaitContainingCatches = awaitContainingCatches = new HashSet<BoundCatchBlock>();
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
321private readonly HashSet<Symbol> _freeVariables = new HashSet<Symbol>();
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.YieldsInTryAnalysis.cs (1)
137this.currentLabels = currentLabels = new HashSet<LabelSymbol>();
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
360_localsInScope = new HashSet<Symbol>();
Lowering\SyntheticBoundNodeFactory.cs (1)
1122var labels = new HashSet<int>();
Lowering\UnmatchedGotoFinder.cs (2)
105_gotos = new HashSet<LabelSymbol>(); 115_targets = new HashSet<LabelSymbol>();
Parser\DocumentationCommentParser.cs (1)
321private readonly HashSet<string> _attributesSeen = new HashSet<string>();
Symbols\Compilation_UsedAssemblies.cs (1)
31var setOfReferences = new HashSet<MetadataReference>(ReferenceEqualityComparer.Instance);
Symbols\MemberSignatureComparer.cs (2)
691var substitutedTypes1 = new HashSet<TypeSymbol>(comparer); 692var substitutedTypes2 = new HashSet<TypeSymbol>(comparer);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
973var names = new HashSet<string>();
Symbols\PropertyOrEventSymbolExtensions.cs (1)
46var symbolsForExplicitlyImplementedAccessors = new HashSet<T>();
Symbols\Source\ConstantEvaluationHelpers.cs (1)
75var map = new HashSet<SourceFieldSymbolWithSyntaxReference>(order.Select(o => o.Field).Distinct());
Symbols\Source\LambdaSymbol.cs (1)
71_declarationDependencies = new HashSet<AssemblySymbol>();
Symbols\Source\LocalFunctionSymbol.cs (1)
48_declarationDependencies = new HashSet<AssemblySymbol>();
Symbols\Source\SourceAssemblySymbol.cs (5)
993var knownModuleNames = new HashSet<String>(StringComparer.OrdinalIgnoreCase); 1216uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance); 1409forwardedTypes = new HashSet<NamedTypeSymbol>(); 2256forwardedTypes = new HashSet<NamedTypeSymbol>() { (NamedTypeSymbol)forwardedType }; 2722handledUnreadFields = new HashSet<FieldSymbol>();
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1979var conversionsAsConversions = new HashSet<MethodSymbol>(ConversionSignatureComparer.Comparer);
Symbols\SubstitutedNamedTypeSymbol.cs (1)
276var replacedFields = new HashSet<Symbol>(ReferenceEqualityComparer.Instance);
Symbols\Symbol_Attributes.cs (2)
486var toRemove = new HashSet<Diagnostic>(ReferenceEqualityComparer.Instance); 851HashSet<NamedTypeSymbol> uniqueAttributeTypes = new HashSet<NamedTypeSymbol>();
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
200var notAnnotatedDiagnosticsSet = new HashSet<Diagnostic>(notAnnotatedDiagnostics.AsEnumerable(), SameDiagnosticComparer.Instance);
Symbols\TypeParameterSymbolExtensions.cs (1)
29visited ??= new HashSet<TypeParameterSymbol>();
Symbols\TypeSymbol.cs (1)
340var visited = new HashSet<NamedTypeSymbol>(SymbolEqualityComparer.ConsiderEverything);
Symbols\TypeSymbolExtensions.cs (1)
1545checkedTypes = new HashSet<TypeSymbol>();
Syntax\SyntaxNodeRemover.cs (2)
61_nodesToRemove = new HashSet<SyntaxNode>(nodesToRemove); 427_directivesToKeep = new HashSet<SyntaxNode>();
Syntax\SyntaxReplacer.cs (7)
91_nodeSet = nodes != null ? new HashSet<SyntaxNode>(nodes) : s_noNodes; 92_tokenSet = tokens != null ? new HashSet<SyntaxToken>(tokens) : s_noTokens; 93_triviaSet = trivia != null ? new HashSet<SyntaxTrivia>(trivia) : s_noTrivia; 95_spanSet = new HashSet<TextSpan>(); 100private static readonly HashSet<SyntaxNode> s_noNodes = new HashSet<SyntaxNode>(); 101private static readonly HashSet<SyntaxToken> s_noTokens = new HashSet<SyntaxToken>(); 102private static readonly HashSet<SyntaxTrivia> s_noTrivia = new HashSet<SyntaxTrivia>();
Utilities\FirstAmongEqualsSet.cs (1)
52_hashSet = new HashSet<T>(equalityComparer);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
164var result = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
30var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
53var declarationsToRemove = new HashSet<StatementSyntax>();
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
110var visitedFieldDeclarations = new HashSet<FieldDeclarationSyntax>();
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
58var accessorLists = new HashSet<AccessorListSyntax>();
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
63var nodesToTrack = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
21private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (12)
11public static readonly ISet<SyntaxKind> AllTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 27public static readonly ISet<SyntaxKind> AllMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 47public static readonly ISet<SyntaxKind> AllGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 61public static readonly ISet<SyntaxKind> AccessibilityModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 69public static readonly ISet<SyntaxKind> AllTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 79public static readonly ISet<SyntaxKind> ClassInterfaceStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 88public static readonly ISet<SyntaxKind> NonEnumTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 100public static readonly ISet<SyntaxKind> ClassInterfaceRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 107public static readonly ISet<SyntaxKind> ClassRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 113public static readonly ISet<SyntaxKind> ClassStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 121public static readonly ISet<SyntaxKind> StructOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 127public static readonly ISet<SyntaxKind> InterfaceOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
75var actualFolderPaths = new HashSet<string>();
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (1)
1485var hashset = new HashSet<string>(expectedTypesInRelativeOrder);
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
39var symbolKindsWithNoCodeBlocks = new HashSet<SymbolKind> 45var missingSyntaxNodes = new HashSet<SyntaxKind>
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
CodeGen\CodeGenDeconstructTests.cs (3)
6035var set = new HashSet<ISymbol>(); 6088var set = new HashSet<ISymbol>(); 6136var set = new HashSet<ISymbol>();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (19)
Attributes\AttributeTests_Assembly.cs (1)
1040var uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance);
Diagnostics\CompilationEventTests.cs (1)
20var expected = new HashSet<string>();
Diagnostics\DiagnosticAnalyzerTests.AllInOne.cs (2)
28var symbolKindsWithNoCodeBlocks = new HashSet<SymbolKind>(); 32var missingSyntaxKinds = new HashSet<SyntaxKind>();
Diagnostics\DiagnosticAnalyzerTests.cs (1)
353var diagIds = new HashSet<string>(diags.Select(d => d.Id));
Diagnostics\GetDiagnosticsTests.cs (12)
454declaredSymbolNames = new HashSet<string>(); 455declaredSymbols = new HashSet<string>(); 456completedCompilationUnits = new HashSet<string>(); 1124var uniqueCallbacks = new HashSet<SyntaxNode>(); 1685var expectedSymbolCallbacks = new HashSet<string>() { "C", "M1" }; 1686var expectedSyntaxNodeCallbacks = new HashSet<string>() { "int x11 = 0;" }; 1687var expectedSyntaxNodeInsideBlockCallbacks = new HashSet<string>(); 1688var expectedOperationCallbacks = new HashSet<string>() { "int x11 = 0" }; 1689var expectedOperationInsideBlockCallbacks = new HashSet<string>(); 1690var expectedBlockSymbolCallbacks = new HashSet<string>(); 1691var expectedSymbolStartSymbolCallbacks = new HashSet<string>(); 1692var expectedSemanticModelTreeCallbacks = new HashSet<SyntaxTree>();
Semantics\ExtensionTests.cs (2)
47Assert.True(expected.All(new HashSet<string>().Add), $"Duplicates were found in '{nameof(expected)}'"); 48Assert.True(actual.All(new HashSet<string>().Add), $"Duplicates were found in '{nameof(actual)}'");
Microsoft.CodeAnalysis.CSharp.Features (67)
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
74var completionItems = new HashSet<CompletionItem>(CompletionItemComparer.Instance);
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
76var alreadyTestedMembers = new HashSet<string>(propertyPatternClause.Subpatterns.Select(
Completion\KeywordRecommenders\AbstractKeywordRecommender.cs (3)
14private static readonly ISet<SyntaxKind> s_validNonInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 25private static readonly ISet<SyntaxKind> s_validInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 37private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\AsyncKeywordRecommender.cs (1)
15private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
14private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ConstKeywordRecommender.cs (2)
14private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 23private static readonly ISet<SyntaxKind> s_validGlobalModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\DelegateKeywordRecommender.cs (1)
15private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\EnumKeywordRecommender.cs (1)
14private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\EventKeywordRecommender.cs (2)
15private static readonly ISet<SyntaxKind> s_validClassModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 31private static readonly ISet<SyntaxKind> s_validStructModifiers = new HashSet<SyntaxKind>(s_validClassModifiers, SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ExplicitKeywordRecommender.cs (2)
14private static readonly ISet<SyntaxKind> s_validNonInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 22private static readonly ISet<SyntaxKind> s_validInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ExtensionKeywordRecommender.cs (2)
13private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer); 14private static readonly ISet<SyntaxKind> s_validTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (3)
15private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 29private static readonly ISet<SyntaxKind> s_validGlobalModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 39private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\FieldKeywordRecommender.cs (1)
16private static readonly ISet<SyntaxKind> s_validTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\FixedKeywordRecommender.cs (1)
14private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ImplicitKeywordRecommender.cs (2)
14private static readonly ISet<SyntaxKind> s_validNonInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 22private static readonly ISet<SyntaxKind> s_validInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\InterfaceKeywordRecommender.cs (1)
14private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\NewKeywordRecommender.cs (2)
17private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 33private static readonly ISet<SyntaxKind> ValidTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\OverrideKeywordRecommender.cs (1)
14private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\ParamKeywordRecommender.cs (1)
15private static readonly ISet<SyntaxKind> s_validTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (1)
16private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\RecordKeywordRecommender.cs (1)
14private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\RefKeywordRecommender.cs (3)
20private static readonly ISet<SyntaxKind> RefMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 42private static readonly ISet<SyntaxKind> RefGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 60private static readonly ISet<SyntaxKind> RefGlobalMemberScriptModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\SealedKeywordRecommender.cs (3)
14private static readonly ISet<SyntaxKind> s_validNonInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 25private static readonly ISet<SyntaxKind> s_validInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 37private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (5)
15private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 26private static readonly ISet<SyntaxKind> s_validNonInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 40private static readonly ISet<SyntaxKind> s_validInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 57private static readonly ISet<SyntaxKind> s_validGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 69private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
15private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (4)
14private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 27private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 44private static readonly ISet<SyntaxKind> s_validGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 56private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\VirtualKeywordRecommender.cs (2)
14private static readonly ISet<SyntaxKind> s_validNonInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 25private static readonly ISet<SyntaxKind> s_validInterfaceMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (2)
15private static readonly ISet<SyntaxKind> s_validClassInterfaceRecordModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 32private static readonly ISet<SyntaxKind> s_validStructModifiers = new HashSet<SyntaxKind>(s_validClassInterfaceRecordModifiers, SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\VolatileKeywordRecommender.cs (1)
15private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
28var variableNamesReadInside = new HashSet<string>(ForEachInfo.Statements
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
381ISet<StatementSyntax> allAffectedStatements = new HashSet<StatementSyntax>(matches.SelectMany(expr => GetApplicableStatementAncestors(expr))); 385var innermostStatements = new HashSet<StatementSyntax>(matches.Select(expr => GetApplicableStatementAncestors(expr).First()));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (2)
40var innermostClauses = new HashSet<SyntaxNode>( 57var allAffectedClauses = new HashSet<SyntaxNode>(matches.SelectMany(expr => expr.GetAncestorsOrThis<SyntaxNode>().Where(IsAnyQueryClause)));
Snippets\CSharpClassSnippetProvider.cs (1)
25private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Snippets\CSharpConstructorSnippetProvider.cs (1)
30private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Snippets\CSharpEnumSnippetProvider.cs (1)
25private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Snippets\CSharpInterfaceSnippetProvider.cs (1)
25private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Snippets\CSharpStructSnippetProvider.cs (1)
25private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
53var declarationsToRemove = new HashSet<StatementSyntax>();
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
110var visitedFieldDeclarations = new HashSet<FieldDeclarationSyntax>();
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
58var accessorLists = new HashSet<AccessorListSyntax>();
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
63var nodesToTrack = new HashSet<SyntaxNode>();
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
151var tempMatches = new HashSet<CastExpressionSyntax>();
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
64var usedLocals = new HashSet<ILocalSymbol>();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
664var obj = new HashSet<int>();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\NullableReferenceTypesTests.cs (1)
157954var reportedDiagnostics = new HashSet<Diagnostic>();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (14)
Compilation\CompilationAPITests.cs (2)
517var hs = new HashSet<MetadataReference> { ref1, ref2, ref3 }; 844var hs = new HashSet<SyntaxTree> { t4, t5, t6 };
Symbols\CorLibrary\CorTypes.cs (1)
58var knownMissingTypes = new HashSet<int>()
Symbols\Metadata\MetadataMemberTests.cs (4)
622var memberNames1 = new HashSet<string>(test1.MemberNames); 632var memberNames2 = new HashSet<string>(test2.MemberNames); 663var memberNames1 = new HashSet<string>(test1.MemberNames); 674var memberNames2 = new HashSet<string>(test2.MemberNames);
Symbols\Metadata\PE\BaseTypeResolution.cs (1)
222var bases = new HashSet<NamedTypeSymbol>();
Symbols\Metadata\PE\TypeForwarders.cs (2)
1478var topLevelTypes = new HashSet<string>(); 1747var topLevelTypes = new HashSet<string>();
Symbols\RequiredMembersTests.cs (1)
35var requiredTypes = new HashSet<NamedTypeSymbol>();
Symbols\Source\IndexedTypeParameterTests.cs (1)
36var set = new HashSet<TypeParameterSymbol>(fifty);
Symbols\TypeTests.cs (2)
2454var uniqueMethods = new HashSet<MethodSymbol>(); 2620var uniqueTypes = new HashSet<TypeSymbol>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\DiagnosticTest.cs (1)
57var set = new HashSet<ErrorCode>();
IncrementalParsing\SyntaxDifferences.cs (1)
25var hashSet = new HashSet<GreenNode>();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
TestAttributesVisitor.cs (1)
22_reported = new HashSet<Symbol>();
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
164var result = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
30var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
21private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (12)
11public static readonly ISet<SyntaxKind> AllTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 27public static readonly ISet<SyntaxKind> AllMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 47public static readonly ISet<SyntaxKind> AllGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 61public static readonly ISet<SyntaxKind> AccessibilityModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 69public static readonly ISet<SyntaxKind> AllTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 79public static readonly ISet<SyntaxKind> ClassInterfaceStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 88public static readonly ISet<SyntaxKind> NonEnumTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 100public static readonly ISet<SyntaxKind> ClassInterfaceRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 107public static readonly ISet<SyntaxKind> ClassRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 113public static readonly ISet<SyntaxKind> ClassStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 121public static readonly ISet<SyntaxKind> StructOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 127public static readonly ISet<SyntaxKind> InterfaceOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Microsoft.CodeAnalysis.EditorFeatures (4)
EditorConfigSettings\Extensions\EnumerableExtensions.cs (1)
14var seenKeys = new HashSet<TKey>();
InlineRename\InlineRenameSession.cs (1)
204var openBuffers = new HashSet<ITextBuffer>();
Shared\Extensions\ITextViewExtensions.cs (1)
24return new HashSet<IContentType>(
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (1)
150_tagSpanSetPool = new ObjectPool<HashSet<TagSpan<TTag>>>(() => new HashSet<TagSpan<TTag>>(this), trimOnFree: false);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Classification\AbstractClassifierTests.cs (1)
287var classificationsSpans = new HashSet<TextSpan>();
Rename\RenamerTests.cs (1)
50var remainingErrors = new HashSet<string>(expectedErrors ?? []);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (15)
CodeFixes\CodeFixServiceTests.cs (2)
115var uniqueTitles = new HashSet<string>(); 1173var variableDeclarations = new HashSet<SyntaxNode>();
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
29var uniqueDiagnosticIds = new HashSet<string>();
Extensions\SetExtensionTests.cs (1)
18var set = new HashSet<string>() { "a", "b", "c" };
Utilities\BloomFilterTests.cs (11)
48var strings = new HashSet<string>(GenerateStrings(2000).Skip(500).Take(1000), comparer); 211new HashSet<string>(GenerateStrings(1_000), comparer), 212new HashSet<string>(GenerateStrings(1_000).Where((s, i) => i % 1 == 0), comparer), 213new HashSet<string>(GenerateStrings(1_000).Where((s, i) => i % 1 == 1), comparer), 214new HashSet<string>(GenerateStrings(10_000), comparer), 215new HashSet<string>(GenerateStrings(10_000).Where((s, i) => i % 1 == 0), comparer), 216new HashSet<string>(GenerateStrings(10_000).Where((s, i) => i % 1 == 1), comparer), 217new HashSet<string>(GenerateStrings(100_000), comparer), 218new HashSet<string>(GenerateStrings(100_000).Where((s, i) => i % 1 == 0), comparer), 219new HashSet<string>(GenerateStrings(100_000).Where((s, i) => i % 1 == 1), comparer), 277var result = new HashSet<long>();
Microsoft.CodeAnalysis.Extensions.Package (9)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Microsoft.CodeAnalysis.Features (46)
AddImport\AbstractAddImportFeatureService.cs (2)
272var seenReferences = new HashSet<PortableExecutableReference>(comparer: this); 457var viableProjects = new HashSet<Project>(solution.Projects.Where(p => p.SupportsCompilation));
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
62var uniqueIdentities = new HashSet<AssemblyIdentity>();
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
79var result = new HashSet<PackageWithAssemblyResult>();
AddPackage\AbstractAddSpecificPackageCodeFixProvider.cs (1)
37var assemblyNames = new HashSet<string> { assemblyName };
CodeFixes\FixAllOccurrences\AbstractFixAllCodeFixCodeAction.cs (1)
45var names = new HashSet<string>();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
220var uniqueIds = new HashSet<string>();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
259var spine = new HashSet<SyntaxNode>();
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
161var handledFolders = new HashSet<string>(StringComparer.Ordinal);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
179var defaultNamespaceFromProjects = new HashSet<string?>(
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
30var preprocessorNames = new HashSet<string>(syntaxFacts.StringComparer);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
73var namespacesInScope = new HashSet<string>(importedNamespaces, syntaxFacts.StringComparer);
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
212var set = new HashSet<Diagnostic>(diagnosticsA, DiagnosticComparer.Instance);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
209var spanSet = new HashSet<DocumentSpan>();
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
22private readonly HashSet<string> LanguageIdentifiers = new(languageIdentifiers, StringComparer.OrdinalIgnoreCase);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
58: new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
217var set = new HashSet<string>();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
530_projectOrDocumentIds = new HashSet<object>(projectIds);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (1)
196var uniqueIds = new HashSet<ProjectId>();
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (1)
158var set = new HashSet<PreviousNextTokenPair>();
ExtractMethod\Extensions.cs (1)
51var set = new HashSet<Diagnostic>(node.GetDiagnostics());
ExtractMethod\MethodExtractor.Analyzer.cs (1)
427var candidates = new HashSet<ISymbol>(readInsideMap);
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
407var set = new HashSet<ITypeParameterSymbol>(AnalyzerResult.MethodTypeParametersInConstraintList);
FindUsages\AbstractFindUsagesService_FindImplementations.cs (2)
97var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 110var seenLocations = new HashSet<(string filePath, TextSpan span)>();
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
15private readonly ISet<INamedTypeSymbol> _seenTypes = new HashSet<INamedTypeSymbol>();
NavigateTo\NavigateToSearcher.cs (1)
43private static readonly ObjectPool<HashSet<INavigateToSearchResult>> s_searchResultPool = new(() => new(NavigateToSearchResultComparer.Instance));
PdbSourceDocument\SymbolSourceDocumentFinder.cs (1)
16var docList = new HashSet<DocumentHandle>();
PullMemberUp\MembersPuller.cs (1)
507var overrideMembersSet = new HashSet<ISymbol>();
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
200var symbolSet = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
62var nodesToRemove = new HashSet<SyntaxNode>(); 170var candidateLocalDeclarationsToRemove = new HashSet<TLocalDeclarationStatement>();
Shared\Extensions\DocumentExtensions.cs (1)
57var totalItems = new HashSet<T>(comparer);
Shared\Utilities\ExtractTypeHelpers.cs (1)
141var allReferencedTypeParameters = new HashSet<ITypeParameterSymbol>(directlyReferencedTypeParameters);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 136private readonly HashSet<IPropertySymbol> _propertiesWithShadowGetAccessorUsages = new(OriginalDefinitionSymbolEqualityComparer.Instance);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
56private readonly ObjectPool<HashSet<string>> _fieldNamesPool = new(() => new(semanticFacts.SyntaxFacts.StringComparer));
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
440var methodParameterNames = new HashSet<string>(comparer);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
23protected static readonly ISet<TypeKind> EnumType = new HashSet<TypeKind> { TypeKind.Enum }; 24protected static readonly ISet<TypeKind> ClassInterfaceModuleStructTypes = new HashSet<TypeKind>
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
46var declarators = new HashSet<SyntaxNode>(); 47var fieldDeclarators = new HashSet<TFieldDeclarationSyntax>();
StackTraceExplorer\StackTraceExplorerService.cs (1)
97var potentialMatches = new HashSet<TextDocument>();
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (1)
141var invalidChars = new HashSet<char>(Path.GetInvalidFileNameChars());
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (1)
102var dependencyNames = new HashSet<string>();
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
167var linkedFiles = new HashSet<DocumentId>();
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\RudeEditDiagnosticTests.cs (3)
27var arg0 = new HashSet<RudeEditKind>() 56var arg2 = new HashSet<RudeEditKind>() 69var arg3 = new HashSet<RudeEditKind>()
Microsoft.CodeAnalysis.InteractiveHost (9)
Interactive\Core\InteractiveHost.Service.cs (1)
734var uniqueDirectories = new HashSet<string>(directories);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
Microsoft.CodeAnalysis.LanguageServer (3)
HostWorkspace\LoadedProject.cs (2)
249var newItems = new HashSet<T>(loadedCollection, comparer); 250var oldItems = new HashSet<T>(comparer);
LanguageServerExportProviderBuilder.cs (1)
96var expectedErrorPartsSet = new HashSet<string>(["CSharpMapCodeService", "PythiaSignatureHelpProvider", "CopilotSemanticSearchQueryExecutor"]);
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
757var seenTitles = new HashSet<string>();
LspServices\LspServices.cs (1)
33private readonly HashSet<IDisposable> _servicesToDispose = new(ReferenceEqualityComparer.Instance);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\HandlerProvider.cs (1)
52var methodHash = new HashSet<(string methodName, string language)>();
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (29)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.PublicApiAnalyzers (24)
DeclarePublicApiAnalyzer.Impl.cs (1)
518var publicApiLinesForSiblingsOfSymbol = new HashSet<string>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Microsoft.CodeAnalysis.Remote.ServiceHub (9)
Host\RemoteExportProviderBuilder.cs (1)
77var expectedErrorPartsSet = new HashSet<string>(["PythiaSignatureHelpProvider", "VSTypeScriptAnalyzerService", "CodeFixService"]);
Host\TestUtils.cs (6)
25var set = new HashSet<Checksum>(); 116var set = new HashSet<Checksum>(); 245var set = new HashSet<Checksum>(); 252var set = new HashSet<Checksum>(); 259var set = new HashSet<Checksum>(); 266var set = new HashSet<Checksum>();
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
48var namespaceInScopeSet = new HashSet<string>(namespaceInScope, syntaxFacts.StringComparer);
Services\ProcessTelemetry\RemoteProcessTelemetryService.cs (1)
81var functionIdsSet = new HashSet<FunctionId>(functionIds);
Microsoft.CodeAnalysis.ResxSourceGenerator (24)
AbstractResxGenerator.cs (1)
151var names = new HashSet<string>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (1)
87var expectedNames = new HashSet<string>();
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (1)
72var expectedNames = new HashSet<string>();
Microsoft.CodeAnalysis.Scripting (2)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
369_lazySuppressedFiles ??= new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
38_lazyVisitedObjects ??= new HashSet<object>(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.Test.Utilities (24)
Assert\AssertEx.cs (2)
479var expectedSet = new HashSet<T>(expected, comparer); 495var expectedSet = new HashSet<T>(expected);
Assert\AssertXml.cs (1)
177HashSet<XElement> children2Used = new HashSet<XElement>(ReferenceEqualityComparer.Instance);
CommonTestBase.cs (4)
597var topOperations = new HashSet<IOperation>(); 669var originalSet = new HashSet<IOperation>(operation.DescendantsAndSelf()); 670var clonedSet = new HashSet<IOperation>(clonedOperation.DescendantsAndSelf()); 681var set = new HashSet<IOperation>(root.DescendantsAndSelf());
CompilationVerifier.cs (1)
959var fullNameSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Diagnostics\CommonDiagnosticAnalyzers.cs (3)
1699var namedTypes = new HashSet<ISymbol>(); 1758_treeCallbackSet = new HashSet<SyntaxTree>(SyntaxTreeComparer.Instance); 1761_textCallbackSet = new HashSet<SourceText>(SourceTextComparer.Instance);
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
270symbolSourceTypes = new HashSet<INamedTypeSymbol>();
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
39HashSet<IFieldSymbol> assignedToFields = new HashSet<IFieldSymbol>(); 40HashSet<IFieldSymbol> mightBecomeReadOnlyFields = new HashSet<IFieldSymbol>();
Diagnostics\LocalCouldBeConstAnalyzer.cs (2)
42HashSet<ILocalSymbol> mightBecomeConstLocals = new HashSet<ILocalSymbol>(); 43HashSet<ILocalSymbol> assignedToLocals = new HashSet<ILocalSymbol>();
Diagnostics\TrackingDiagnosticAnalyzer.cs (2)
99var actualSyntaxKinds = new HashSet<TLanguageKindEnum>(_callLog.Where(a => FilterByAbstractName(a, "SyntaxNode")).Select(e => e.SyntaxKind)); 100var savedSyntaxKindsPatterns = new HashSet<TLanguageKindEnum>(expectedMissingSyntaxKinds);
Metadata\MetadataSignatureUnitTestHelper.cs (1)
145var distinctSignatures = new HashSet<string>();
Mocks\VirtualizedRelativePathResolver.cs (1)
22_existingFullPaths = new HashSet<string>(existingFullPaths, StringComparer.Ordinal);
Platform\Desktop\RuntimeAssemblyManager.cs (2)
74_loadedAssemblies = new HashSet<Assembly>(); 82_preloadedSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
TargetFrameworkUtil.cs (1)
349var nameSet = new HashSet<string>(getNames(references), StringComparer.OrdinalIgnoreCase);
TestableFileSystem.cs (1)
57var set = new HashSet<string>(existingPaths, comparer);
Microsoft.CodeAnalysis.Threading.Package (8)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
Microsoft.CodeAnalysis.UnitTests (28)
CachingLookupTests.cs (1)
256HashSet<string> lookedUp = new HashSet<string>(comparer);
Collections\HashSet\ISet_Generic_Tests`1.cs (6)
135HashSet<T> expected = new HashSet<T>(set, GetIEqualityComparer()); 153HashSet<T> beforeOperation = new HashSet<T>(set, GetIEqualityComparer()); 160HashSet<T> expected = new HashSet<T>(comparer); 282HashSet<T> expected = new HashSet<T>(comparer); 297HashSet<T> expected = new HashSet<T>(set, comparer); 653HashSet<T> expected = new HashSet<T>(comparer);
Collections\ImmutableSegmentedHashSetTest.cs (2)
208var expectedSet = new HashSet<string>(set, set.KeyComparer); 227return new HashSet<T>();
Collections\ImmutableSegmentedListBuilderTest.cs (1)
195var elemsToRemove = new HashSet<int>() { 0, 1, 2, 3, 4, 5 };
Collections\ImmutableSetTest.cs (1)
492var uniqueValues = new HashSet<T>(values);
Collections\ImmutableSetTest.nonnetstandard.cs (4)
115var expectedSet = new HashSet<T>(set); 127var expectedSet = new HashSet<T>(set); 141var expected = new HashSet<T>(set); 153var expected = new HashSet<T>(set);
Collections\ImmutablesTestBase.cs (1)
181var ensureUniqueness = new HashSet<double>();
Collections\List\IEnumerable.Generic.Tests.cs (2)
603HashSet<T> firstValues = new HashSet<T>(count); 604HashSet<T> secondValues = new HashSet<T>(count);
Collections\List\IEnumerable.NonGeneric.Tests.cs (2)
297HashSet<object> firstValues = new HashSet<object>(count); 298HashSet<object> secondValues = new HashSet<object>(count);
Collections\TopologicalSortTests.cs (1)
214var seen = new HashSet<T>();
CorLibTypesTests.cs (1)
72var knownMissingTypes = new HashSet<SpecialType>()
FileSystem\RelativePathResolverTests.cs (2)
29var fs = new HashSet<string> 104var fs = new HashSet<string>
MetadataReferences\AssemblyIdentityTestBase.cs (2)
49internal static readonly HashSet<char> ClrInvalidCharacters = new HashSet<char> 58internal static readonly HashSet<char> ClrBackslashEscapedCharacters = new HashSet<char>
StrongNameProviderTests.cs (2)
27var fs = new HashSet<string> 93: base(searchPaths.NullToEmpty(), new VirtualStrongNameFileSystem(new HashSet<string>(existingFullPaths, StringComparer.OrdinalIgnoreCase)))
Microsoft.CodeAnalysis.VisualBasic (46)
Analysis\FlowAnalysis\AlwaysAssignedWalker.vb (1)
36Private ReadOnly _labelsInside As New HashSet(Of LabelSymbol)()
Analysis\FlowAnalysis\DataFlowsInWalker.vb (3)
33Dim unassignedWithoutStatic As New HashSet(Of Symbol) 44Return If(succeeded, walker._dataFlowsIn, New HashSet(Of Symbol)()) 50Private ReadOnly _dataFlowsIn As HashSet(Of Symbol) = New HashSet(Of Symbol)()
Analysis\FlowAnalysis\DataFlowsOutWalker.vb (4)
25Private ReadOnly _dataFlowsOut As New HashSet(Of Symbol)() 28Private ReadOnly _assignedInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 44Dim unassignedWithoutStatic As New HashSet(Of Symbol) 60Return If(success, result, New HashSet(Of Symbol)())
Analysis\FlowAnalysis\EntryPointsWalker.vb (1)
32Private ReadOnly _entryPoints As HashSet(Of LabelStatementSyntax) = New HashSet(Of LabelStatementSyntax)()
Analysis\FlowAnalysis\ReadWriteWalker.vb (7)
52Private ReadOnly _readInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 53Private ReadOnly _writtenInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 54Private ReadOnly _readOutside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 55Private ReadOnly _writtenOutside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 56Private ReadOnly _captured As HashSet(Of Symbol) = New HashSet(Of Symbol)() 57Private ReadOnly _capturedInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 58Private ReadOnly _capturedOutside As HashSet(Of Symbol) = New HashSet(Of Symbol)()
Analysis\FlowAnalysis\UnassignedVariablesWalker.vb (2)
28Return If(walker.Analyze(), walker._result, New HashSet(Of Symbol)()) 34Private ReadOnly _result As HashSet(Of Symbol) = New HashSet(Of Symbol)()
Analysis\FlowAnalysis\VariablesDeclaredWalker.vb (1)
27Private ReadOnly _variablesDeclared As New HashSet(Of Symbol)
Binding\Binder_Lookup.vb (5)
1201Dim seenContainingTypes As New HashSet(Of NamedTypeSymbol)() 1372Return IsDerivedInterface(base, derived, basesBeingResolved, New HashSet(Of Symbol), useSiteInfo) 1463Dim processed As New HashSet(Of InterfaceInfo) 1703processedInterfaces = New HashSet(Of InterfaceInfo) 1999Dim processed As New HashSet(Of InterfaceInfo)
Binding\ExecutableCodeBinder.vb (1)
238_boundSimpleNames = New HashSet(Of Integer)
Lowering\Diagnostics\DiagnosticsPass_ExpressionLambdas.vb (1)
14Private ReadOnly _expressionTreePlaceholders As New HashSet(Of BoundNode)(ReferenceEqualityComparer.Instance)
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (4)
74Friend containsLiftingLambda As HashSet(Of BoundNode) = New HashSet(Of BoundNode)() 104Friend capturedVariables As HashSet(Of Symbol) = New HashSet(Of Symbol)(ReferenceEqualityComparer.Instance) 114Friend ReadOnly declaredInsideExpressionLambda As New HashSet(Of Symbol)(ReferenceEqualityComparer.Instance) 169needsParentFrame = New HashSet(Of BoundNode)
Lowering\SyntheticBoundNodeFactory.vb (1)
710Dim labels = New HashSet(Of Integer)()
Symbols\ExtensionMethods.vb (1)
24Dim typeParameters As New HashSet(Of TypeParameterSymbol)
Symbols\Metadata\PE\PEPropertyOrEventHelpers.vb (1)
37Dim symbolsForExplicitlyImplementedAccessors = New HashSet(Of T)()
Symbols\ReducedExtensionMethodSymbol.vb (1)
64Dim hashSetOfTypeParametersToFix As New HashSet(Of TypeParameterSymbol)
Symbols\Source\SourceNamedTypeSymbol.vb (3)
884Dim constraintTypes1 = New HashSet(Of TypeSymbol) 1167Dim interfacesInThisPartial As New HashSet(Of NamedTypeSymbol)() 1224Dim interfacesInThisPartial As New HashSet(Of TypeSymbol)()
Symbols\Symbol_Attributes.vb (1)
465Dim uniqueAttributeTypes = New HashSet(Of NamedTypeSymbol)
Symbols\TypeSymbol.vb (1)
163Dim visited = New HashSet(Of NamedTypeSymbol)()
Syntax\SyntaxReplacer.vb (7)
79Me._nodeSet = If(nodes IsNot Nothing, New HashSet(Of SyntaxNode)(nodes), s_noNodes) 80Me._tokenSet = If(tokens IsNot Nothing, New HashSet(Of SyntaxToken)(tokens), s_noTokens) 81Me._triviaSet = If(trivia IsNot Nothing, New HashSet(Of SyntaxTrivia)(trivia), s_noTrivia) 83Me._spanSet = New HashSet(Of TextSpan)(Me._nodeSet.Select(Function(n) n.FullSpan).Concat( 96Private Shared ReadOnly s_noNodes As HashSet(Of SyntaxNode) = New HashSet(Of SyntaxNode)() 97Private Shared ReadOnly s_noTokens As HashSet(Of SyntaxToken) = New HashSet(Of SyntaxToken)() 98Private Shared ReadOnly s_noTrivia As HashSet(Of SyntaxTrivia) = New HashSet(Of SyntaxTrivia)()
Microsoft.CodeAnalysis.Workspaces (47)
Diagnostics\HostDiagnosticAnalyzers.cs (1)
284var seen = new HashSet<DiagnosticAnalyzer>(map1.Values.SelectMany(v => v));
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
286var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
FindSymbols\SymbolFinder.cs (2)
166var result = new HashSet<TSymbol>(); 189var linkedSymbols = new HashSet<ISymbol> { symbol };
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
89var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id));
Log\AggregateLogger.cs (2)
25var set = new HashSet<ILogger>(); 67var set = new HashSet<ILogger>();
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
117var documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(documentsByProject); 714var documentIds = new HashSet<DocumentId>();
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
70var appliedTextSpans = new HashSet<TextSpan>(); 189var modifiedTokensInComplexifiedStatements = new HashSet<SyntaxToken>();
Shared\Utilities\ExtensionOrderer.Graph.cs (1)
35var seenNodes = new HashSet<Node<TExtension, TMetadata>>();
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
185set = new(OriginalPathComparer);
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Workspace\Solution\ProjectChanges.cs (6)
26var oldRefs = new HashSet<ProjectReference>(OldProject.ProjectReferences); 38var newRefs = new HashSet<ProjectReference>(NewProject.ProjectReferences); 50var oldMetadata = new HashSet<MetadataReference>(OldProject.MetadataReferences); 62var newMetadata = new HashSet<MetadataReference>(NewProject.MetadataReferences); 74var oldAnalyzerReferences = new HashSet<AnalyzerReference>(OldProject.AnalyzerReferences); 86var newAnalyzerReferences = new HashSet<AnalyzerReference>(NewProject.AnalyzerReferences);
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
108var newTransitiveReferences = new HashSet<ProjectId>(referencedProjectIds);
Workspace\Solution\SolutionChanges.cs (2)
65var oldAnalyzerReferences = new HashSet<AnalyzerReference>(_oldSolution.AnalyzerReferences); 77var newAnalyzerReferences = new HashSet<AnalyzerReference>(_newSolution.AnalyzerReferences);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
963var syntaxTreesInWorkspaceStates = new HashSet<SyntaxTree>(
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildProjectLoader.Worker.cs (2)
125var processedPaths = new HashSet<string>(PathUtilities.Comparer); 474var paths = new HashSet<string>(PathUtilities.Comparer);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (11)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
NetCoreTests.cs (6)
220var projectPaths = new HashSet<string>(); 221var outputFilePaths = new HashSet<string>(); 310var projectPaths = new HashSet<string>(); 311var outputFilePaths = new HashSet<string>(); 325var expectedNames = new HashSet<string>() 333var actualNames = new HashSet<string>();
SolutionGeneration.cs (1)
68var files = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
VisualStudioMSBuildWorkspaceTests.cs (1)
86var fileNames = new HashSet<string>(references.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace`1.cs (1)
632var documentFilePaths = new HashSet<string>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
FindReferencesTests.cs (2)
344var expectedMatchedLines = new HashSet<int> { 3, 13, 14 }; 412var projectIds = new HashSet<ProjectId>();
UtilityTest\IntervalTreeTests.cs (6)
321var set1 = new HashSet<string>(GetIntervalsThatOverlapWith(tree, start, length).Select(i => i.Item3)); 322var set2 = new HashSet<string>(spans.Where(t => 328var set3 = new HashSet<string>(GetIntervalsThatIntersectWith(tree, start, length).Select(i => i.Item3)); 329var set4 = new HashSet<string>(spans.Where(t => 338Assert.True(new HashSet<string>(spans.Select(t => t.Item3)).SetEquals(tree.Select(i => i.Item3))); 343=> new HashSet<T>(values);
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
HandlerProvider.cs (1)
52var methodHash = new HashSet<(string methodName, string language)>();
Microsoft.CSharp (5)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
563HashSet<CType> distinctCallingTypes = new HashSet<CType>();
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (1)
744HashSet<Name> names = new HashSet<Name>();
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (1)
1613HashSet<CType> typeSet = new HashSet<CType>();
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (2)
20private static readonly HashSet<Type> s_typesWithConversionsLoaded = new HashSet<Type>(); 21private static readonly HashSet<NameHashKey> s_namesLoadedForEachType = new HashSet<NameHashKey>();
Microsoft.Data.Analysis (6)
DataFrame.Join.cs (2)
195supplementaryJoinColumnsNullIndices = new HashSet<long>(); 283HashSet<long> intersection = calculateIntersection ? new HashSet<long>() : null;
DataFrameColumns\ArrowStringDataFrameColumn.cs (1)
493nullIndices = new HashSet<long>();
DataFrameColumns\StringDataFrameColumn.cs (1)
413nullIndices = new HashSet<long>();
IDataView.Extension.cs (1)
54selectColumnsSet = new HashSet<string>(selectColumns);
PrimitiveDataFrameColumn.cs (1)
618nullIndices = new HashSet<long>();
Microsoft.Data.Analysis.Tests (4)
DataFrame.IOTests.cs (1)
1653HashSet<Type> possibleTypes = new HashSet<Type>(types);
DataFrameTests.cs (1)
712HashSet<int?> uniqueRowValues = new HashSet<int?>();
DataFrameTests.Merge.cs (2)
770HashSet<int> intersection = new HashSet<int>(); 786HashSet<int> intersection = new HashSet<int>();
Microsoft.DotNet.ArcadeLogging (2)
PipelinesLogger.cs (2)
24private readonly HashSet<Guid> _detailedLoggedSet = new HashSet<Guid>(); 49_ignoredTargets = new HashSet<string>(ignoredTargets, StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.Build.Manifest (1)
VersionIdentifier.cs (1)
14private static readonly HashSet<string> _knownTags = new HashSet<string>
Microsoft.DotNet.Build.Tasks.Feed (7)
src\PublishArtifactsInManifestBase.cs (3)
538symbolAssets : new HashSet<BlobArtifactModel>(); 1134PackagesByCategory[categoryKey] = new HashSet<PackageArtifactModel>() { packageAsset }; 1162BlobsByCategory[categoryKey] = new HashSet<BlobArtifactModel>() { blobAsset };
src\PublishArtifactsInManifestV3.cs (1)
177FeedConfigs[categoryKey] = new HashSet<TargetFeedConfig>();
src\PublishArtifactsInManifestV4.cs (1)
172FeedConfigs[categoryKey] = new HashSet<TargetFeedConfig>();
src\PublishBuildToMaestro.cs (1)
191var targetChannelIds = new HashSet<int>(defaultChannels.Select(dc => dc.Channel.Id));
src\PublishSignedAssets.cs (1)
84HashSet<PackageIdentity> packagesToPublish = new HashSet<PackageIdentity>(
Microsoft.DotNet.Build.Tasks.Feed.Tests (6)
LatestLinksManagerTests.cs (4)
82var assetsToPublish = new HashSet<string> 126var assetsToPublish = new HashSet<string> { "assets/symbols/Microsoft.stuff.symbols.nupkg", "assets/Microsoft.stuff.zip", "assets/Microsoft.stuff.json", "assets/Microsoft.stuff.json.zip" }; 156var assetsToPublish = new HashSet<string> { "assets/symbols/Microsoft.stuff.symbols.nupkg", "assets/Microsoft.stuff.zip", "assets/Microsoft.stuff.json", "assets/Microsoft.stuff.json.zip" }; 193var assetsToPublish = new HashSet<string> { "assets/symbols/Microsoft.stuff.symbols.nupkg", "bar/Microsoft.stuff.zip", "assets/Microsoft.stuff.json", "assets/plop/Microsoft.stuff.json.zip" };
PublishToSymbolServerTest.cs (2)
44var feedConfigsForSymbols = new HashSet<TargetFeedConfig> 229task.BlobsByCategory.Add(TargetFeedContentType.Symbols, new HashSet<Manifest.BlobArtifactModel>()
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateRpmPackage.cs (1)
112HashSet<string> ownedDirectories = new(OwnedDirectories.Select(d => d.ItemSpec));
Microsoft.DotNet.Build.Tasks.Packaging (24)
ApplyMetaPackages.cs (3)
66value = new HashSet<string>(); 91suppressMetaPackages.Add(metaPackageThisPackageIsIn, new HashSet<string> { "All" } ); 111metaPackagesToAdd[metaPackage] = metaPackageFrameworks = new HashSet<NuGetFramework>();
CreateTrimDependencyGroups.cs (1)
223Packages = new HashSet<TaskItemPackageDependency>(packages.Where(d => d.Id != PlaceHolderDependency));
FilterUnknownPackages.cs (1)
46var baseLinePackageIds = new HashSet<string>(BaseLinePackages.NullAsEmpty().Select(b => b.ItemSpec));
GeneratePackageReport.cs (2)
183private static HashSet<string> s_ignoredFrameworks = new HashSet<string>() 320_unusedTargetPaths = new HashSet<string>();
GetLayoutFiles.cs (2)
50return String.IsNullOrEmpty(rids) ? new HashSet<string>() : new HashSet<string>(rids.Split(';'));
GetPackageDestination.cs (1)
76var suppressions = new HashSet<NuGetFramework>(
HarvestPackage.cs (4)
298var preserveRefVersion = new HashSet<Version>(desktopLibVersions); 510_pathsToExclude = new HashSet<string>(PathsToExclude.NullAsEmpty().Select(NormalizePath), StringComparer.OrdinalIgnoreCase); 523_pathsNotIncluded = new HashSet<string>(_pathsToInclude.Keys); 534_pathsToSuppress = new HashSet<string>(PathsToSuppress.NullAsEmpty().Select(NormalizePath));
PackageIndex.cs (2)
33public HashSet<string> IndexSources { get; set; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 369public HashSet<Version> StableVersions { get; set; } = new HashSet<Version>();
UpdatePackageIndex.cs (2)
97_packageIdsToInclude = new HashSet<string>(PackageIds.Select(i => i.ItemSpec), StringComparer.OrdinalIgnoreCase); 287var assmVersions = new HashSet<Version>(assemblyVersions.NullAsEmpty().Where(v => v != null));
ValidateFrameworkPackage.cs (2)
44var permittedInbox = GetSuppressionValues(Suppression.PermitInbox) ?? new HashSet<string>(); 69var permittedMissingInbox = GetSuppressionValues(Suppression.PermitMissingInbox) ?? new HashSet<string>();
ValidatePackage.cs (3)
171var runtimeFxSuppression = GetSuppressionValues(Suppression.PermitRuntimeTargetMonikerMismatch) ?? new HashSet<string>(); 389var assemblyVersions = new HashSet<Version>(allAssemblies.Select(f => VersionUtility.As4PartVersion(f.Version))); 494HashSet<NuGetFramework> explicitlySupportedFrameworks = new HashSet<NuGetFramework>(NuGetFramework.Comparer);
ValidationTask.cs (1)
129values = new HashSet<string>(valuesToAdd);
Microsoft.DotNet.Build.Tasks.Packaging.Tests (1)
CreateTrimDependencyGroupsTests.cs (1)
343var expectedTFMs = new HashSet<string>()
Microsoft.DotNet.Build.Tasks.Workloads (5)
CreateVisualStudioWorkload.wix.cs (3)
138HashSet<SwixComponent> swixComponents = new(); 139HashSet<SwixPackageGroup> swixPackageGroups = new(); 261buildData[sourcePackage].FeatureBands[platform] = new();
CreateVisualStudioWorkloadSet.wix.cs (1)
44HashSet<SwixPackageGroup> swixPackageGroups = new();
Wix\WixToolTaskBase.cs (1)
16private HashSet<string> _extensions = new();
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\MembersMustExistAnalyzer.cs (1)
23private HashSet<string> _apisToEnsureExist = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Analyzers\PinvokeAnalyzer.cs (1)
67private HashSet<string> _isNotSupportedOnWin7 = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.GenFacades (4)
SourceGenerator.cs (3)
19private readonly HashSet<string> _ignoreMissingTypesList = new HashSet<string>(); 37? new HashSet<string>(ignoreMissingTypesList) 38: new HashSet<string>();
TypeParser.cs (1)
18HashSet<string> types = new HashSet<string>();
Microsoft.DotNet.Helix.JobSender (1)
Payloads\AdhocPayload.cs (1)
54var filesSeen = new HashSet<string>();
Microsoft.DotNet.Helix.Sdk (3)
CheckAzurePipelinesTestResults.cs (1)
223HashSet<string> expectedFailures = ExpectedTestFailures?.Select(i => i.GetMetadata("Identity")).ToHashSet() ?? new HashSet<string>();
ProvisioningProfileProvider.cs (2)
126HashSet<string> rootLevelAppBundles = new(); 127HashSet<string> appBundlesWithProfile = new();
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
260var expectedSet = new HashSet<T>(expected, comparer); 275var expectedSet = new HashSet<T>(expected);
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Microsoft.DotNet.PackageTesting (4)
GetCompatiblePackageTargetFrameworks.cs (1)
103packageTfmMapping.Add(forwardTfm, new HashSet<NuGetFramework> { reverseTfm });
VerifyClosure.cs (2)
42private HashSet<string> otherFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 352var nodeIds = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
VerifyTypes.cs (1)
34private HashSet<string> ignoredTypes = new HashSet<string>();
Microsoft.DotNet.SharedFramework.Sdk (5)
src\CreateFrameworkListFile.cs (1)
77var usedFileClasses = new HashSet<string>();
src\FileUtilities.cs (1)
16private static readonly HashSet<string> s_assemblyExtensions = new HashSet<string>(
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (2)
42private HashSet<string> otherFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 352var nodeIds = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (1)
34private HashSet<string> ignoredTypes = new HashSet<string>();
Microsoft.DotNet.SignCheckLibrary (1)
Verification\Exclusion.cs (1)
167cache[key] = new HashSet<string>();
Microsoft.DotNet.SignTool (7)
src\BatchSignUtil.cs (1)
121var trackedSet = new HashSet<SignedFileContentKey>();
src\Configuration.cs (3)
164packages = new HashSet<string>(); 622filesErrored = new HashSet<SignedFileContentKey>(); 790packages = new HashSet<string>();
src\SignToolConstants.cs (2)
38public static readonly HashSet<string> SignableExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) 125new HashSet<string>(StringComparer.OrdinalIgnoreCase)
src\SignToolTask.cs (1)
416private readonly HashSet<string> specialExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.DotNet.SignTool.Tests (1)
SignToolTests.cs (1)
1001var noWarn3rdPartySet = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "EmptyPKT.dll" };
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\WritePackageUsageData.cs (1)
191var properties = new HashSet<string>(
src\UsageReport\WriteUsageReports.cs (1)
91var poisonNupkgFilenames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.XliffTasks (4)
Model\VsctDocument.cs (2)
61HashSet<string> idsAlreadySeen = new(); 62HashSet<string> conflictingIds = new();
Model\XlfDocument.cs (1)
287return new HashSet<string>(untranslatedResourceIDs, StringComparer.Ordinal);
Tasks\GatherXlf.cs (1)
30HashSet<string> outputPaths = new(StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.XUnitAssert.Tests (101)
CollectionAssertsTests.cs (28)
329 IEnumerable<string> set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Hi there" }; 367 IEnumerable<string> set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Hi there" }; 548 IEnumerable<string> set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Hi there" }; 604 IEnumerable<string> set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Hi there" }; 1498 var expected = new HashSet<int> { 42, 2112 }; 1499 var actual = new HashSet<int> { 2112, 42 }; 1512 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 1513 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 1525 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 1526 var actual = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 1534 var expected = new HashSet<int> { 42, 2112 }; 1535 var actual = new HashSet<int> { 2600, 42 }; 1552 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 1553 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, true }) }; 1569 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 1570 var actual = new HashSet<BitArray> { new BitArray(new[] { true, true }) }; 2165 var expected = new HashSet<int> { 42, 2112 }; 2166 var actual = new HashSet<int> { 2112, 42 }; 2187 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 2188 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 2208 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 2209 var actual = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 2225 var expected = new HashSet<int> { 42, 2112 }; 2226 var actual = new HashSet<int> { 2600, 42 }; 2235 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 2236 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, true }) }; 2244 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 2245 var actual = new HashSet<BitArray> { new BitArray(new[] { true, true }) };
EqualityAssertsTests.cs (36)
1221 var expected = new HashSet<int> { 1, 2, 3 }; 1222 var actual = new HashSet<int> { 1, 2, 3 }; 1230 var expected = new HashSet<int> { 1, 2, 3 }; 1231 var actual = new HashSet<int> { 1, 2, 4 }; 1247 var expected = new HashSet<int> { 1, 2, 3 }; 1248 var actual = new HashSet<int> { 2, 3, 1 }; 1256 var expected = new HashSet<int> { 1, 2, 3 }; 1257 var actual = new HashSet<int> { 2, 4, 1 }; 1273 var expected = new HashSet<int> { 1, 2, 3 }; 1274 var actual = new HashSet<int> { 1, 2 }; 1290 var expected = new HashSet<int> { 1, 2 }; 1291 var actual = new HashSet<int> { 1, 2, 3 }; 1307 var expected = new HashSet<string> { "bar", "foo" }; 1320 object expected = new HashSet<int> { 42 }; 1321 object actual = new HashSet<long> { 42L }; 1341 var expected = new HashSet<string> { "bar" }; 1342 var actual = new HashSet<string> { "baz" }; 1466 var actual = new HashSet<string> { "bar" }; 1479 var actual = new HashSet<string> { "baz" }; 1548 var actual = new HashSet<string> { "baz" }; 3450 var expected = new HashSet<int> { 1, 2, 3 }; 3451 var actual = new HashSet<int> { 1, 2, 3 }; 3467 var expected = new HashSet<int> { 1, 2, 3 }; 3468 var actual = new HashSet<int> { 1, 2, 4 }; 3476 var expected = new HashSet<int> { 1, 2, 3 }; 3477 var actual = new HashSet<int> { 2, 3, 1 }; 3493 var expected = new HashSet<int> { 1, 2, 3 }; 3494 var actual = new HashSet<int> { 2, 4, 1 }; 3502 var expected = new HashSet<string> { "bar", "foo" }; 3527 object expected = new HashSet<int> { 42 }; 3528 object actual = new HashSet<long> { 42L }; 3540 var expected = new HashSet<string> { "bar" }; 3541 var actual = new HashSet<string> { "baz" }; 3652 var actual = new HashSet<string> { "bar" }; 3678 var actual = new HashSet<string> { "baz" }; 3734 var actual = new HashSet<string> { "baz" };
SetAssertsTests.cs (36)
17 var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "forty-two" }; 34 var set = new HashSet<string>() { "eleventeen" }; 67 var set = new HashSet<string>() { "eleventeen" }; 84 var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "forty-two" }; 117 Assert.Throws<ArgumentNullException>("expectedSubset", () => Assert.ProperSubset(null!, new HashSet<int>())); 123 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 124 var actual = new HashSet<int> { 1, 2, 3 }; 140 var expectedSubset = new HashSet<int> { 1, 2, 3, 4 }; 141 var actual = new HashSet<int> { 1, 2, 3 }; 149 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 150 var actual = new HashSet<int> { 1, 2, 7 }; 166 var ex = Record.Exception(() => Assert.ProperSubset(new HashSet<int>(), null)); 183 Assert.Throws<ArgumentNullException>("expectedSuperset", () => Assert.ProperSuperset(null!, new HashSet<int>())); 189 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 190 var actual = new HashSet<int> { 1, 2, 3 }; 206 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 207 var actual = new HashSet<int> { 1, 2, 3, 4 }; 215 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 216 var actual = new HashSet<int> { 1, 2, 7 }; 232 var ex = Record.Exception(() => Assert.ProperSuperset(new HashSet<int>(), null)); 249 Assert.Throws<ArgumentNullException>("expectedSubset", () => Assert.Subset(null!, new HashSet<int>())); 255 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 256 var actual = new HashSet<int> { 1, 2, 3 }; 264 var expectedSubset = new HashSet<int> { 1, 2, 3, 4 }; 265 var actual = new HashSet<int> { 1, 2, 3 }; 273 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 274 var actual = new HashSet<int> { 1, 2, 7 }; 290 var ex = Record.Exception(() => Assert.Subset(new HashSet<int>(), null)); 307 Assert.Throws<ArgumentNullException>("expectedSuperset", () => Assert.Superset(null!, new HashSet<int>())); 313 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 314 var actual = new HashSet<int> { 1, 2, 3 }; 322 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 323 var actual = new HashSet<int> { 1, 2, 3, 4 }; 331 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 332 var actual = new HashSet<int> { 1, 2, 7 }; 347 var ex = Record.Exception(() => Assert.Superset(new HashSet<int>(), null));
Utility\ReadOnlySet.cs (1)
13 hashSet = new HashSet<T>(items, comparer);
Microsoft.Extensions.AI.Evaluation (2)
CompositeEvaluator.cs (1)
47var metricNames = new HashSet<string>();
Utilities\TaskExtensions.cs (1)
65var remaining = new HashSet<Task<T>>(concurrentTasks);
Microsoft.Extensions.AI.Evaluation.Console (1)
Utilities\ExceptionUtilities.cs (1)
24var seen = new HashSet<Exception>();
Microsoft.Extensions.AI.Evaluation.Integration.Tests (2)
ResultsTests.cs (2)
220new HashSet<string> 276new HashSet<string>
Microsoft.Extensions.AI.Evaluation.Quality (3)
IntentResolutionEvaluator.cs (1)
118var toolDefinitionNames = new HashSet<string>(context?.ToolDefinitions.Select(td => td.Name) ?? []);
TaskAdherenceEvaluator.cs (1)
117var toolDefinitionNames = new HashSet<string>(context?.ToolDefinitions.Select(td => td.Name) ?? []);
ToolCallAccuracyEvaluator.cs (1)
128var toolDefinitionNames = new HashSet<string>(context.ToolDefinitions.Select(td => td.Name));
Microsoft.Extensions.ApiDescription.Client (3)
GetOpenApiReferenceMetadata.cs (2)
53var codeGenerators = new HashSet<string>(); 54var destinations = new HashSet<string>();
MetadataSerializer.cs (1)
21private static readonly HashSet<char> CharsToEscapeHash = new HashSet<char>(CharsToEscape);
Microsoft.Extensions.ApiDescription.Client.Tests (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Microsoft.Extensions.AsyncState (1)
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Compliance.Abstractions (2)
Classification\DataClassificationSet.cs (1)
80var combinedClassifications = new HashSet<DataClassification>(_classifications);
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Compliance.Testing.Tests (2)
FakeRedactorTests.cs (2)
95var numbersSetRedacted = new HashSet<int>(sequenceNumbersRedacted); 96var numbersSetRequested = new HashSet<int>(sequenceNumbersRequested);
Microsoft.Extensions.Configuration.Binder (2)
ConfigurationBinder.cs (2)
229HashSet<string> propertyNames = new(modelProperties.Select(mp => mp.Name), 626HashSet<string> propertyNames = new(StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.DependencyInjection (2)
CallSiteJsonFormatter.cs (1)
21var context = new CallSiteFormatterContext(stringBuilder, 0, new HashSet<ServiceCallSite>());
ServiceLookup\CallSiteFactory.cs (1)
626bestConstructorParameterTypes = new HashSet<Type>();
Microsoft.Extensions.DependencyModel (1)
DependencyContextWriter.cs (1)
262var dependencies = new HashSet<Dependency>();
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (1)
165var distinctRegistrations = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
HealthCheckPublisherHostedService.cs (1)
107var delayPeriodGroups = new HashSet<(TimeSpan Delay, TimeSpan Period)>();
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (2)
HealthCheckRegistration.cs (2)
68Tags = new HashSet<string>(tags ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase); 120Tags = new HashSet<string>(tags ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
ResourceMonitoringOptions.Windows.cs (1)
21public ISet<string> SourceIpAddresses { get; set; } = new HashSet<string>();
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
ResourceMonitoringOptionsCustomValidatorTests.cs (2)
21SourceIpAddresses = new HashSet<string> { "" } 35SourceIpAddresses = new HashSet<string> { "127.0.0.1", "[::]" }
Windows\Tcp6TableInfoTests.cs (3)
234SourceIpAddresses = new HashSet<string> { "[::1]" }, 251SourceIpAddresses = new HashSet<string> { "[::1]" }, 269SourceIpAddresses = new HashSet<string> { "[::1]" },
Windows\TcpTableInfoTests.cs (3)
177SourceIpAddresses = new HashSet<string> { "127.0.0.1" }, 193SourceIpAddresses = new HashSet<string> { "127.0.0.1" }, 211SourceIpAddresses = new HashSet<string> { "127.0.0.1" },
Windows\WindowsCountersTests.cs (2)
26SourceIpAddresses = new HashSet<string> { "127.0.0.1", "[::1]" }, 68SourceIpAddresses = new HashSet<string> { "127.0.0.1", "[::1]" },
Microsoft.Extensions.Diagnostics.Testing (2)
Logging\FakeLogCollectorOptions.cs (2)
25public ISet<string> FilteredCategories { get; set; } = new HashSet<string>(); 35public ISet<LogLevel> FilteredLevels { get; set; } = new HashSet<LogLevel>();
Microsoft.Extensions.Diagnostics.Testing.Tests (2)
Logging\FakeLoggerTests.cs (2)
204FilteredLevels = new HashSet<LogLevel>() 226FilteredCategories = new HashSet<string>()
Microsoft.Extensions.FileProviders.Composite (1)
CompositeDirectoryContents.cs (1)
63var names = new HashSet<string>();
Microsoft.Extensions.FileSystemGlobbing (3)
Internal\MatcherContext.cs (3)
25private readonly HashSet<LiteralPathSegment> _declaredLiteralFileSegments = new HashSet<LiteralPathSegment>(); 34_declaredLiteralFolderSegmentInString = new HashSet<string>(StringComparisonHelper.GetStringComparer(comparison)); 46_declaredLiteralFolderSegmentInString = new HashSet<string>(StringComparisonHelper.GetStringComparer(comparison));
Microsoft.Extensions.Http (1)
DependencyInjection\HttpClientBuilderExtensions.cs (1)
584var sensitiveHeaders = new HashSet<string>(redactedLoggedHeaderNames, StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.Http.Diagnostics (2)
Logging\LoggingOptions.cs (2)
80public ISet<string> RequestBodyContentTypes { get; set; } = new HashSet<string>(); 88public ISet<string> ResponseBodyContentTypes { get; set; } = new HashSet<string>();
Microsoft.Extensions.Http.Diagnostics.Tests (53)
Logging\HttpClientLoggerTest.cs (12)
206ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 207RequestBodyContentTypes = new HashSet<string> { TextPlain }, 298ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 299RequestBodyContentTypes = new HashSet<string> { TextPlain }, 405ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 406RequestBodyContentTypes = new HashSet<string> { TextPlain }, 501ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 502RequestBodyContentTypes = new HashSet<string> { TextPlain }, 615ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 616RequestBodyContentTypes = new HashSet<string> { TextPlain }, 885ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 886RequestBodyContentTypes = new HashSet<string> { TextPlain },
Logging\HttpRequestBodyReaderTest.cs (9)
36RequestBodyContentTypes = new HashSet<string> { "text/plain" } 56RequestBodyContentTypes = new HashSet<string> { "text/plain" } 80RequestBodyContentTypes = new HashSet<string> { "text/plain" } 101RequestBodyContentTypes = new HashSet<string> { "text/plain" } 128RequestBodyContentTypes = new HashSet<string> { "text/plain" }, 152RequestBodyContentTypes = new HashSet<string> { "text/plain" }, 173RequestBodyContentTypes = new HashSet<string> { "text/plain" } 206RequestBodyContentTypes = new HashSet<string> { "text/plain" } 227RequestBodyContentTypes = new HashSet<string> { "text/plain" }
Logging\HttpRequestReaderTest.cs (15)
63RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 64ResponseBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 127RequestBodyContentTypes = new HashSet<string> { PlainTextMedia }, 128ResponseBodyContentTypes = new HashSet<string> { PlainTextMedia }, 189RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 190ResponseBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 263RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 264ResponseBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 336RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 394RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 395ResponseBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 465RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 466ResponseBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 532RequestBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain }, 533ResponseBodyContentTypes = new HashSet<string> { MediaTypeNames.Text.Plain },
Logging\HttpResponseBodyReaderTest.cs (9)
43ResponseBodyContentTypes = new HashSet<string> { TextPlain } 63ResponseBodyContentTypes = new HashSet<string> { TextPlain } 82ResponseBodyContentTypes = new HashSet<string> { TextPlain } 104ResponseBodyContentTypes = new HashSet<string> { TextPlain } 124ResponseBodyContentTypes = new HashSet<string> { TextPlain } 148ResponseBodyContentTypes = new HashSet<string> { TextPlain } 176ResponseBodyContentTypes = new HashSet<string> { TextPlain } 209ResponseBodyContentTypes = new HashSet<string> { TextPlain }, 237ResponseBodyContentTypes = new HashSet<string> { TextPlain },
Logging\LoggingOptionsTest.cs (2)
53var testContentTypes = new HashSet<string> { "application/xml" }; 63var testContentTypes = new HashSet<string> { "application/xml" };
Logging\MediaTypeCollectionExtensionsTest.cs (2)
27var collection = new HashSet<string>(_readableContentTypes, StringComparer.OrdinalIgnoreCase).ToFrozenSet(StringComparer.OrdinalIgnoreCase); 44var collection = new HashSet<string>(_readableContentTypes, StringComparer.OrdinalIgnoreCase).ToFrozenSet(StringComparer.OrdinalIgnoreCase);
Telemetry\BackslashDownstreamDependencyMetadata.cs (2)
11private static readonly ISet<string> _uniqueHostNameSuffixes = new HashSet<string> 16private static readonly ISet<RequestMetadata> _requestMetadataSet = new HashSet<RequestMetadata>
Telemetry\EmptyRouteDependencyMetadata.cs (2)
11private static readonly ISet<string> _uniqueHostNameSuffixes = new HashSet<string> 16private static readonly ISet<RequestMetadata> _requestMetadataSet = new HashSet<RequestMetadata>
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Http.Resilience.Tests (1)
Routing\RoutingStrategyTest.cs (1)
44var strategies = new HashSet<RequestRoutingStrategy>();
Microsoft.Extensions.Localization (1)
ResourceManagerStringLocalizer.cs (1)
186var resourceNames = new HashSet<string>();
Microsoft.Extensions.Logging.Generators (4)
LoggerMessageGenerator.Parser.cs (3)
71var eventIds = new HashSet<int>(); 72var eventNames = new HashSet<string>(); 645HashSet<string> shadowedNames = new(StringComparer.Ordinal);
LoggerMessageGenerator.Roslyn3.11.cs (1)
50public HashSet<ClassDeclarationSyntax> ClassDeclarations { get; } = new();
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
113visited ??= new HashSet<object>(ReferenceEqualityComparer.Instance); 122visited ??= new HashSet<object>(ReferenceEqualityComparer.Instance);
Microsoft.Extensions.Options.SourceGeneration (3)
OptionsSourceGenContext.cs (1)
35value = new HashSet<object>();
Parser.cs (2)
30private readonly HashSet<ITypeSymbol> _visitedModelTypes = new(SymbolEqualityComparer.Default); 277var addedMembers = new HashSet<string>(members.Select(m => m.Name));
Microsoft.Extensions.ServiceDiscovery (1)
ServiceDiscoveryHttpClientBuilderExtensions.cs (1)
56public HashSet<string?> ClientNames { get; } = new HashSet<string?>();
Microsoft.Extensions.Telemetry (2)
Latency\Internal\LatencyContextRegistrySet.cs (1)
60HashSet<string> keys = new HashSet<string>(names);
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Telemetry.Abstractions (1)
src\Shared\Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Microsoft.Extensions.Validation.ValidationsGenerator (3)
Extensions\IncrementalValuesProviderExtensions.cs (1)
26HashSet<TSource> set = new(comparer);
Parsers\ValidationsGenerator.AttributeParser.cs (1)
22var validatableTypes = new HashSet<ValidatableType>(ValidatableTypeComparer.Instance);
Parsers\ValidationsGenerator.TypesParser.cs (1)
34var validatableTypes = new HashSet<ValidatableType>(ValidatableTypeComparer.Instance);
Microsoft.Gen.ComplianceReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
56var shortAttributeNames = new HashSet<string>();
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
56var shortAttributeNames = new HashSet<string>();
Microsoft.Gen.Logging (13)
Emission\Emitter.cs (1)
96var classificationAttrs = new HashSet<string>();
Parsing\Parser.cs (5)
45var ids = new HashSet<int>(); 46var eventNames = new HashSet<string>(); 481var names = new HashSet<string>(StringComparer.Ordinal); 559var paramDataClassAttributes = new HashSet<string>( 643HashSet<string> shadowedNames = new(StringComparer.Ordinal);
Parsing\Parser.LogProperties.cs (3)
51var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 92var seenProps = new HashSet<string>(); 162var classification = new HashSet<string>();
Parsing\Parser.Records.cs (2)
22var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 34var overriddenMembers = new HashSet<string>();
Parsing\SymbolLoader.cs (1)
93var ignorePropsSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\GeneratorUtilities.cs (1)
56var shortAttributeNames = new HashSet<string>();
Microsoft.Gen.Logging.Unit.Tests (2)
LoggingMethodParameterTests.cs (1)
46ClassificationAttributeTypes = new HashSet<string>(new[] { PrivateDataAttributeType })
LogParserUtilitiesTests.cs (1)
142new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default),
Microsoft.Gen.MetadataExtractor (5)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
66var metricNames = new HashSet<string>(); 280var tagHashSet = new HashSet<string>(); 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\GeneratorUtilities.cs (1)
56var shortAttributeNames = new HashSet<string>();
Microsoft.Gen.Metrics (5)
Parser.cs (4)
66var metricNames = new HashSet<string>(); 280var tagHashSet = new HashSet<string>(); 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\GeneratorUtilities.cs (1)
56var shortAttributeNames = new HashSet<string>();
Microsoft.Gen.MetricsReports (5)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
66var metricNames = new HashSet<string>(); 280var tagHashSet = new HashSet<string>(); 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\GeneratorUtilities.cs (1)
56var shortAttributeNames = new HashSet<string>();
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
22private static readonly HashSet<string> s_unsupportedTypeNames = new()
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
183HashSet<Project> projectsToAddUnsafe = new();
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\CustomMarshallerAttributeFixer.cs (2)
49uniqueMarshallersToFix[uniqueMarshallerFixKey] = membersToAdd = new HashSet<string>(); 132HashSet<string> missingMemberNames = new();
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
183HashSet<Project> projectsToAddUnsafe = new();
Microsoft.Maui (4)
Hosting\Internal\RegisteredHandlerServiceTypeSet.cs (2)
15 private readonly HashSet<Type> _concreteHandlerServiceTypeSet = new(); 16 private readonly HashSet<Type> _interfaceHandlerServiceTypeSet = new();
Platform\ElementExtensions.cs (1)
35 static HashSet<Type> handlersWithConstructors = new HashSet<Type>();
WindowOverlay\WindowOverlay.cs (1)
22 readonly HashSet<IWindowOverlayElement> _windowElements = new();
Microsoft.Maui.Controls (9)
Application\Application.cs (1)
350 var innerKeys = new HashSet<string>(StringComparer.Ordinal);
Element\Element.cs (1)
634 HashSet<string> _pendingHandlerUpdatesFromBPSet = new HashSet<string>();
ListProxy.cs (1)
183 _indexesCounted = new HashSet<int>();
Routing.cs (1)
143 keys = new HashSet<string>(StringComparer.Ordinal);
TemplatedItemsList.cs (1)
1228 readonly HashSet<TemplatedItemsList<TView, TItem>> _attachedItems = new HashSet<TemplatedItemsList<TView, TItem>>();
View\View.cs (1)
143 HashSet<IGestureRecognizer> compositeGestureRecognizers = new(GestureController.CompositeGestureRecognizers);
VisualElement\VisualElement.cs (1)
1550 var innerKeys = new HashSet<string>(StringComparer.Ordinal);
VisualStateManager.cs (1)
156 readonly HashSet<string> _names = new HashSet<string>(StringComparer.Ordinal);
Window\Window.cs (1)
67 HashSet<IWindowOverlay> _overlays = new HashSet<IWindowOverlay>();
Microsoft.Maui.Controls.Build.Tasks (1)
XamlCache.cs (1)
54 GetOrAdd(_resourceNamesInUse, variableDefinition, _ => new HashSet<string>(StringComparer.Ordinal));
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (1)
170 knowValuesSet = new HashSet<string>(knownValues, StringComparer.OrdinalIgnoreCase);
VisibilityDesignTypeConverter.cs (1)
10 private static readonly HashSet<string> supportedValues = new HashSet<string>(validValues, StringComparer.OrdinalIgnoreCase);
Microsoft.ML.AutoML (16)
AutoMLExperiment\ITrialResultManager.cs (2)
55_trialResultsHistory = new HashSet<TrialResult>(trialResults, new TrialResult()); 56_newTrialResults = new HashSet<TrialResult>(new TrialResult());
ColumnInference\ColumnTypeInference.cs (1)
327var usedNames = new HashSet<string>();
ColumnInference\PurposeInference.cs (1)
127var seen = new HashSet<string>();
DatasetDimensions\DatasetDimensionsUtil.cs (1)
16var seen = new HashSet<string>();
PipelineSuggesters\PipelineSuggester.cs (2)
56var visitedPipelines = new HashSet<SuggestedPipeline>(history.Select(h => h.Pipeline)); 113var selectedTrainerNames = new HashSet<TrainerName>(selectedTrainers.Select(t => t.TrainerName));
Sweepers\SmacSweeper.cs (2)
185HashSet<Tuple<double, ParameterSet>> configurations = new HashSet<Tuple<double, ParameterSet>>(); 204var retainedConfigs = new HashSet<ParameterSet>(bestConfigurations.Select(x => x.Item2));
Sweepers\SweeperBase.cs (2)
51var prevParamSets = new HashSet<ParameterSet>(previousRuns?.Select(r => r.ParameterSet).ToList() ?? new List<ParameterSet>()); 52var result = new HashSet<ParameterSet>();
TrainerExtensions\SweepableParams.cs (1)
217return new HashSet<string>(sweepableParams.Select(p => p.Name));
TrainerExtensions\TrainerExtensionCatalog.cs (1)
106allowList = new HashSet<TrainerName>(allowList);
TransformInference\TransformInference.cs (1)
479var existingColNames = new HashSet<string>(columns.Select(c => c.ColumnName));
Tuner\SmacTuner.cs (2)
196var configurations = new HashSet<Tuple<double, Parameter>>(); 211var retainedConfigs = new HashSet<Parameter>(orderedConfigurations.Select(x => x.Item2), comparer);
Microsoft.ML.CodeGenerator (7)
CodeGenerator\CSharp\CodeGenerator.cs (6)
27private static readonly HashSet<string> _recommendationTrainers = new HashSet<string>() { TrainerName.MatrixFactorization.ToString() }; 28private static readonly HashSet<string> _lightGbmTrainers = new HashSet<string>() { TrainerName.LightGbmBinary.ToString(), TrainerName.LightGbmMulti.ToString(), 30private static readonly HashSet<string> _mklComponentsTrainers = new HashSet<string>() { TrainerName.OlsRegression.ToString(), TrainerName.SymbolicSgdLogisticRegressionBinary.ToString() }; 31private static readonly HashSet<string> _fastTreeTrainers = new HashSet<string>() { TrainerName.FastForestBinary.ToString(), TrainerName.FastForestRegression.ToString(), 33private static readonly HashSet<string> _imageTransformers = new HashSet<string>() { EstimatorName.RawByteImageLoading.ToString() }; 34private static readonly HashSet<string> _imageClassificationTrainers = new HashSet<string>() { TrainerName.ImageClassification.ToString() };
Utils.cs (1)
329HashSet<String> columnNamesSet = new HashSet<String>(columnNames);
Microsoft.ML.Core (6)
ComponentModel\ComponentCatalog.cs (1)
76_cachedAssemblies = new HashSet<string>();
Data\ProgressReporter.cs (2)
371_namesUsed = new HashSet<string>(); 438var seen = new HashSet<int>();
Utilities\SupervisedBinFinder.cs (2)
71var seenValues = new HashSet<Single>(); 149var seenValues = new HashSet<Double>();
Utilities\Utils.cs (1)
153set = new HashSet<T>();
Microsoft.ML.Core.Tests (7)
UnitTests\TestEntryPoints.cs (4)
292var excludeSet = new HashSet<string>(); 309var variables = new HashSet<string>(); 6129Assert.Subset(new HashSet<string>() { "Private", "?", "Federal-gov" }, new HashSet<string>() { name.ToString() });
UnitTests\TestVBuffer.cs (3)
326var aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 799HashSet<int> aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 800HashSet<int> bIndices = new HashSet<int>(b.Items().Select(iv => iv.Key));
Microsoft.ML.Data (33)
Commands\TypeInfoCommand.cs (2)
97var dstKinds = new HashSet<InternalDataKind>(); 113dstToSrcMap[dstKinds] = srcKinds = new HashSet<InternalDataKind>();
Data\DataViewTypeManager.cs (1)
26private static readonly HashSet<Type> _bannedRawTypes = new HashSet<Type>()
Data\SchemaDefinition.cs (1)
423HashSet<string> colNames = new HashSet<string>();
DataLoadSave\Binary\BinaryLoader.cs (1)
332var kinds = new HashSet<string>();
DataLoadSave\Binary\BinarySaver.cs (3)
275var kinds = new HashSet<string>(); 584HashSet<int> activeSet = new HashSet<int>(activeColumns.Select(col => col.SourceIndex)); 739HashSet<int> active = new HashSet<int>(actives.Select(cc => cc.SourceIndex));
DataLoadSave\Text\TextLoader.cs (2)
1213var separators = new HashSet<char>(); 1226var separators = new HashSet<char>();
DataView\CacheDataView.cs (1)
667HashSet<OrderedWaiter> waiters = new HashSet<OrderedWaiter>();
DataView\Transposer.cs (2)
871var activeSrcSet = new HashSet<int>(); 1279var activeSrcSet = new HashSet<int>();
Evaluators\EvaluatorBase.cs (2)
80var stratIndices = Utils.Size(stratCols) > 0 ? new HashSet<int>(stratCols.Select(col => col.Index)) : new HashSet<int>();
Model\Pfa\BoundPfaContext.cs (3)
54_unavailable = new HashSet<string>(); 65var fieldNames = new HashSet<string>(); 119var fieldNames = new HashSet<string>();
Model\Pfa\PfaContext.cs (2)
102_variables = new HashSet<string>(); 106_types = new HashSet<string>();
Model\Pfa\SavePfaCommand.cs (2)
89return new HashSet<string>(); 90return new HashSet<string>(toDrop.Split(','));
Scorers\RowToRowScorerBase.cs (1)
171var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Transforms\ColumnBindingsBase.cs (1)
688var namesUsed = new HashSet<string>();
Transforms\ColumnSelecting.cs (2)
281var names = new HashSet<string>(); 353var names = new HashSet<string>();
Transforms\InvertHashUtils.cs (2)
281pairSet = _slotToValueSet[dstSlot] = new HashSet<Pair>(_comparer); 296pairSet = _slotToValueSet[dstSlot] = new HashSet<Pair>(_comparer);
Transforms\MetadataDispatcher.cs (2)
223kinds = new HashSet<string>(); 366var set = new HashSet<string>(kindsSrc);
Transforms\OneToOneTransformerBase.cs (1)
23var newNames = new HashSet<string>();
Transforms\TransformBase.cs (1)
820var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Transforms\ValueMapping.cs (1)
291HashSet<TValue> valueSet = new HashSet<TValue>();
Microsoft.ML.Ensemble (2)
PipelineEnsemble.cs (2)
51_inputColIndices = new HashSet<int>(); 422inputCols = new HashSet<string>();
Microsoft.ML.EntryPoints (2)
FeatureCombiner.cs (1)
59var featNames = new HashSet<string>();
JsonUtils\JsonManifestUtils.cs (1)
156var collectedFields = new HashSet<string>();
Microsoft.ML.FastTree (4)
FastTree.cs (1)
1397HashSet<int> constructed = new HashSet<int>();
Training\RegressionTreeNodeDocuments.cs (2)
65documentsInNode = new HashSet<int>(Partitioning.DocumentsInLeaf(~NodeIndex)); 69documentsInNode = new HashSet<int>();
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (1)
301CategoricalThresholds = new HashSet<int>();
Microsoft.ML.IntegrationTests (1)
IntrospectiveTraining.cs (1)
353var uniqueValues = new HashSet<string>();
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckAnalyzer.cs (1)
80private static readonly HashSet<string> _targetSet = new HashSet<string>(new[]
Microsoft.ML.OnnxConverter (11)
OnnxContextImpl.cs (2)
53_variableNames = new HashSet<string>(); 54_nodeNames = new HashSet<string>();
OnnxExportExtensions.cs (1)
26var outputColumnNamesToDrop = new HashSet<string>();
SaveOnnxCommand.cs (8)
126return new HashSet<string>(); 128return new HashSet<string>(toDrop); 167inputColumnNamesToDrop = inputColumnNamesToDrop ?? new HashSet<string>(); 168outputColumnNamesToDrop = outputColumnNamesToDrop ?? new HashSet<string>(); 169HashSet<string> inputColumns = new HashSet<string>(); 263var inputKeyDataViewTypeColumnsNames = new HashSet<string>(); 268var passThroughColumnNames = new HashSet<string>(); 269var outputColumnNames = new HashSet<string>();
Microsoft.ML.OnnxTransformer (1)
OnnxUtils.cs (1)
495new HashSet<Type>
Microsoft.ML.Predictor.Tests (1)
TestTransposer.cs (1)
108HashSet<int> forceDenseSlotSet = new HashSet<int>(forceDenseSlot);
Microsoft.ML.ResultProcessor (2)
ResultProcessor.cs (2)
97SettingHeaderNames = new HashSet<string>(); 114ResultHeaderNames = new HashSet<string>();
Microsoft.ML.StandardTrainers (1)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
206HashSet<string> labelNamesSet = new HashSet<string>();
Microsoft.ML.Sweeper (5)
Algorithms\Grid.cs (2)
71var result = new HashSet<ParameterSet>(); 159var result = new HashSet<ParameterSet>();
Algorithms\SmacSweeper.cs (2)
199HashSet<Tuple<double, ParameterSet>> configurations = new HashSet<Tuple<double, ParameterSet>>(); 216HashSet<ParameterSet> retainedConfigs = new HashSet<ParameterSet>();
AsyncSweeper.cs (1)
210_nullRuns = new HashSet<int>();
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
385var newNames = new HashSet<string>();
Microsoft.ML.TestFramework (2)
BaseTestPredictorsMaml.cs (1)
228HashSet<string> removeArgs = new HashSet<string>();
DataPipe\TestDataPipeBase.cs (1)
473var hs = new HashSet<string>();
Microsoft.ML.Tests (5)
OnnxConversionTest.cs (2)
808var redundantInputColumnNames = new HashSet<string> { "Label" }; 810var redundantOutputColumnNames = new HashSet<string> { "Label", "F1", "F2", "Features" };
Scenarios\ClusteringTests.cs (1)
72var labels = new HashSet<uint>();
Transformers\CustomMappingTests.cs (1)
161state.SeenValues = new HashSet<float>();
Transformers\ValueMappingTests.cs (1)
580var allowedKeyPool = new HashSet<ReadOnlyMemory<char>>(allowedKeys.DenseValues());
Microsoft.ML.TimeSeries (1)
PredictionEngine.cs (1)
169var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Microsoft.ML.Tokenizers (1)
Model\EnglishRobertaTokenizer.cs (1)
971HashSet<(string, string)> pairs = new();
Microsoft.ML.TorchSharp (6)
AutoFormerV2\ObjectDetectionMetrics.cs (1)
85var labelSet = new HashSet<string>();
AutoFormerV2\ObjectDetectionTrainer.cs (2)
247var uniqueLabels = new HashSet<uint>(); 734_inputColIndices = new HashSet<int>();
NasBert\TextClassificationTrainer.cs (1)
153var uniqueLabels = new HashSet<uint>();
Roberta\QATrainer.cs (1)
716_inputColIndices = new HashSet<int>();
TorchSharpBaseTrainer.cs (1)
459InputColIndices = new HashSet<int>();
Microsoft.ML.Transforms (5)
Dracula\DictCountTable.cs (1)
233var keys = new HashSet<long>();
LoadTransform.cs (1)
77var allTags = new HashSet<string>();
MutualInformationFeatureSelection.cs (1)
177var colSet = new HashSet<string>();
OptionalColumnTransform.cs (1)
377var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Text\NgramHashingTransformer.cs (1)
199HashSet<int> columnWithInvertHash = new HashSet<int>();
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
628var newNames = new HashSet<string>();
Microsoft.VisualStudio.LanguageServices (8)
CommonControls\MemberSelectionViewModel.cs (2)
172var visited = new HashSet<ISymbol>(); 173var result = new HashSet<ISymbol>();
MoveStaticMembers\StaticMemberSelectionViewModel.cs (2)
88var visited = new HashSet<ISymbol>(); 89var result = new HashSet<ISymbol>();
Preview\PreviewEngine.cs (1)
161var linkedDocumentIds = new HashSet<DocumentId>();
ProjectSystem\RuleSets\RuleSetEventHandler.cs (1)
184var ruleSetDeletions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Snippets\AbstractSnippetInfoService.cs (1)
216return new HashSet<string>(updatedSnippets.Select(s => s.Shortcut), StringComparer.OrdinalIgnoreCase)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (1)
551var latestDiagnosticsToFix = filterStaleDiagnostics ? new HashSet<DiagnosticData>() : null;
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\CSharpSnippetInfoService.cs (1)
25private readonly ISet<string> _formatTriggeringSnippets = new HashSet<string>(new string[] { "#region", "#endregion" });
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
20var seen = new HashSet<string>();
PresentationBuildTasks (2)
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (1)
391HashSet<string> localMarkupPages = new HashSet<string>(_mcPass1.PageMarkup.Select(x => x.GetMetadata(SharedStrings.FullPath)), StringComparer.OrdinalIgnoreCase);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
1995_names = new HashSet<string>();
PresentationCore (5)
MS\Internal\Resources\ContentFileHelper.cs (2)
53return new HashSet<string>(); 63contentFiles = new HashSet<string>(assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (1)
26new HashSet<WeakReference<IAppDomainShutdownListener>>();
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1902hs = new HashSet<AutomationPeer>();
System\Windows\Media\MediaContext.cs (1)
202_registeredICompositionTargets = new HashSet<ICompositionTarget>();
PresentationFramework (5)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (1)
16private static readonly HashSet<string> ProjectedRuntimeClassNames = new HashSet<string>();
System\Windows\Markup\RestrictiveXamlXmlReader.cs (3)
21private static readonly HashSet<string> AllXamlNamespaces = new HashSet<string>(XamlLanguage.XamlNamespaces); 27HashSet<string> allowedTypesFromRegistry = new HashSet<string>(); 213private HashSet<Type> _safeTypesSet = new HashSet<Type>() {
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
64_clrNamespaces = new HashSet<string>();
Replay (2)
Replay.cs (2)
149var outputSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 223var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Roslyn.Diagnostics.Analyzers (29)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Roslyn.Diagnostics.CSharp.Analyzers (16)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
164var result = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
30var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
21private static readonly ISet<SyntaxKind> s_validLocalFunctionModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\SyntaxKindSet.cs (12)
11public static readonly ISet<SyntaxKind> AllTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 27public static readonly ISet<SyntaxKind> AllMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 47public static readonly ISet<SyntaxKind> AllGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 61public static readonly ISet<SyntaxKind> AccessibilityModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 69public static readonly ISet<SyntaxKind> AllTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 79public static readonly ISet<SyntaxKind> ClassInterfaceStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 88public static readonly ISet<SyntaxKind> NonEnumTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 100public static readonly ISet<SyntaxKind> ClassInterfaceRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 107public static readonly ISet<SyntaxKind> ClassRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 113public static readonly ISet<SyntaxKind> ClassStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 121public static readonly ISet<SyntaxKind> StructOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 127public static readonly ISet<SyntaxKind> InterfaceOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\TelemetryPanel.xaml.cs (1)
60var seenType = new HashSet<Type>();
Roslyn.VisualStudio.Next.UnitTests (2)
Options\VisualStudioOptionStorageTests.cs (1)
291var set = new HashSet<string>();
Services\ServiceHubServicesTests.cs (1)
1854var expectedSet = new HashSet<T>(expected);
RulesetToEditorconfigConverter (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
RunTests (2)
AssemblyScheduler.cs (2)
103var unmatchedLocalTests = new HashSet<string>(); 106var matchedRemoteTests = new HashSet<string>();
Shared (1)
Pools\PooledSetPolicy.cs (1)
24public override HashSet<T> Create() => new(_comparer);
Shared.Tests (3)
Pools\PoolTests.cs (3)
61var set = new HashSet<Foo>(); 251var uniques = new HashSet<Foo>(); 268var objects = new HashSet<Foo>();
SocialWeather (1)
PersistentConnectionLifeTimeManager.cs (1)
22connection.Items["groups"] = new HashSet<string>();
System.CodeDom (1)
src\libraries\Common\src\System\CSharpHelpers.cs (1)
14private static readonly HashSet<string> s_fixedStringLookup = new HashSet<string>()
System.Collections.Immutable (8)
System\Collections\Frozen\FrozenHashTable.cs (2)
149Debug.Assert(!hashCodesAreUnique || new HashSet<int>(hashCodes.ToArray()).Count == hashCodes.Length); 163new HashSet<int>(hashCodes.Length);
System\Collections\Frozen\FrozenSet.cs (2)
40new(source.Length, equalityComparer); // we assume there are few-to-no duplicates when using this API 80newSet = new HashSet<T>(source, comparer);
System\Collections\Frozen\String\KeyAnalyzer.cs (1)
66HashSet<string> set = new HashSet<string>(
System\Collections\Immutable\ImmutableHashSet_1.cs (3)
746var otherSet = new HashSet<T>(other, origin.EqualityComparer); 883var otherSet = new HashSet<T>(other, origin.EqualityComparer); 956var otherSet = new HashSet<T>(other, origin.EqualityComparer);
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (2)
149HashSet<string> mainTypeMemberNames = new HashSet<string>(mainType.GetProperties().Select(p => p.Name)); 154HashSet<string> buddyTypeMembers = new HashSet<string>(buddyFields.Concat(buddyProperties), StringComparer.Ordinal);
System.ComponentModel.Composition (7)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (1)
259_contractNamesOnNonInterfaces = new HashSet<string>();
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogChangeProxy.cs (1)
25_removedParts = new HashSet<ComposablePartDefinition>(removedParts);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (3)
40private readonly HashSet<ComposablePartDefinition> _rejectedParts = new HashSet<ComposablePartDefinition>(); 42private readonly HashSet<IDisposable> _partsToDispose = new HashSet<IDisposable>(); 783var affectedRejections = new HashSet<ComposablePartDefinition>();
System\ComponentModel\Composition\Hosting\FilteredCatalog.Traversal.cs (1)
84var traversedParts = new HashSet<ComposablePartDefinition>();
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (1)
176candidates = new HashSet<ComposablePartDefinition>();
System.ComponentModel.TypeConverter (2)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (1)
117var filter = new HashSet<object>(attributes.Count);
System\Drawing\ColorConverter.cs (1)
20var set = new HashSet<Color>(ColorTable.Colors.Values);
System.Composition.Hosting (1)
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
39var @checked = new HashSet<ExportDescriptorPromise>();
System.Data.Common (2)
System\Data\TypeLimiter.cs (2)
130private static readonly HashSet<Type> s_allowedTypes = new HashSet<Type>() 203m_allowedTypes = new HashSet<Type>(allowedTypes.Where(type => type != null));
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\DsesActivitySourceListener.cs (1)
74var allSources = _listenToActivitySourceNames ??= new(StringComparer.OrdinalIgnoreCase);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
341private HashSet<string> _sharedSessionClientIds = new HashSet<string>();
System.Formats.Cbor (2)
System\Formats\Cbor\Reader\CborReader.Map.cs (1)
186return _keyEncodingRanges = new HashSet<(int Offset, int Length)>(_keyEncodingComparer);
System\Formats\Cbor\Writer\CborWriter.Map.cs (1)
198return _keyEncodingRanges = new HashSet<(int Offset, int Length)>(GetKeyEncodingComparer());
System.IO.Packaging (2)
System\IO\Packaging\XmlCompatibilityReader.cs (2)
1770_names ??= new HashSet<string>(); 1821_names ??= new HashSet<string>();
System.Linq (13)
System\Linq\Distinct.cs (2)
78var set = new HashSet<TKey>(DefaultInternalSetCapacity, comparer); 124_set = new HashSet<TSource>(DefaultInternalSetCapacity, _comparer);
System\Linq\Distinct.SpeedOpt.cs (3)
12public override TSource[] ToArray() => ICollectionToArray(new HashSet<TSource>(_source, _comparer)); 14public override List<TSource> ToList() => new List<TSource>(new HashSet<TSource>(_source, _comparer)); 16public override int GetCount(bool onlyIfCheap) => onlyIfCheap ? -1 : new HashSet<TSource>(_source, _comparer).Count;
System\Linq\Except.cs (2)
81var set = new HashSet<TSource>(second, comparer); 94var set = new HashSet<TKey>(second, comparer);
System\Linq\Intersect.cs (2)
78var set = new HashSet<TSource>(second, comparer); 91var set = new HashSet<TKey>(second, comparer);
System\Linq\ToCollection.cs (1)
257return new HashSet<TSource>(source, comparer);
System\Linq\Union.cs (2)
78var set = new HashSet<TKey>(DefaultInternalSetCapacity, comparer); 139var set = new HashSet<TSource>(DefaultInternalSetCapacity, _comparer);
System\Linq\Union.SpeedOpt.cs (1)
14var set = new HashSet<TSource>(_comparer);
System.Linq.AsyncEnumerable (13)
System\Linq\Distinct.cs (1)
37HashSet<TSource> set = new(comparer);
System\Linq\DistinctBy.cs (2)
49HashSet<TKey> set = new(comparer); 99HashSet<TKey> set = new(comparer);
System\Linq\Except.cs (1)
46HashSet<TSource> set = new(comparer);
System\Linq\ExceptBy.cs (2)
54HashSet<TKey> set = new(comparer); 114HashSet<TKey> set = new(comparer);
System\Linq\Intersect.cs (1)
47set = new(comparer);
System\Linq\IntersectBy.cs (2)
60set = new(comparer); 125set = new(comparer);
System\Linq\ToHashSetAsync.cs (1)
33HashSet<TSource> set = new(comparer);
System\Linq\Union.cs (1)
39HashSet<TSource> set = new(comparer);
System\Linq\UnionBy.cs (2)
44HashSet<TKey> set = new(comparer); 95HashSet<TKey> set = new(comparer);
System.Linq.Expressions (17)
System\Dynamic\BindingRestrictions.cs (1)
145private readonly HashSet<BindingRestrictions> _unique = new HashSet<BindingRestrictions>();
System\Dynamic\Utils\Helpers.cs (1)
19var set = new HashSet<T>(cmp);
System\Linq\Expressions\BlockExpression.cs (1)
1071var set = new HashSet<ParameterExpression>();
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
38private readonly HashSet<LabelScopeInfo> _definitions = new HashSet<LabelScopeInfo>();
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
395var uniqueKeys = new HashSet<decimal>();
System\Linq\Expressions\Compiler\VariableBinder.cs (1)
182currentScope.MergedScopes ??= new HashSet<BlockExpression>(ReferenceEqualityComparer.Instance);
System\Linq\Expressions\Interpreter\LabelInfo.cs (2)
211_definitions = set = new HashSet<LabelScopeInfo>() { (LabelScopeInfo)_definitions }; 226var set = new HashSet<T>(cmp);
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
2789public readonly HashSet<ParameterExpression> _hoistedParameters = new HashSet<ParameterExpression>();
System\Linq\Expressions\Interpreter\TypeOperations.cs (3)
517var parameters = new HashSet<ParameterExpression>(); 542_shadowedVars.Push(new HashSet<ParameterExpression>(node.Variables)); 560_shadowedVars.Push(new HashSet<ParameterExpression> { node.Variable });
System\Linq\Expressions\LambdaExpression.cs (2)
862var set = new HashSet<ParameterExpression>(); 944var set = new HashSet<ParameterExpression>();
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (3)
72var parameters = new HashSet<ParameterExpression>(); 97_shadowedVars.Push(new HashSet<ParameterExpression>(node.Variables)); 115_shadowedVars.Push(new HashSet<ParameterExpression> { node.Variable });
System.Linq.Parallel (5)
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (2)
180_hashLookup = new HashSet<TInputOutput>(_comparer); 270HashSet<TInputOutput> rightLookup = new HashSet<TInputOutput>(_comparer);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
167_hashLookup = new HashSet<TInputOutput>(_comparer);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
219_hashLookup = new HashSet<TInputOutput>(_comparer);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
136_hashLookup = new HashSet<TInputOutput>(comparer);
System.Net.HttpListener (1)
System\Net\Managed\HttpEndPointListener.cs (1)
73_unregisteredConnections = new HashSet<HttpConnection>();
System.Private.CoreLib (8)
src\libraries\System.Private.CoreLib\src\Internal\Runtime\InteropServices\ComponentActivator.cs (1)
26private static readonly HashSet<string> s_loadedInDefaultContext = new HashSet<string>(StringComparer.InvariantCulture);
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlySet.cs (1)
28public static ReadOnlySet<T> Empty { get; } = new ReadOnlySet<T>(new HashSet<T>());
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (1)
67var unique = new HashSet<char>(_hashEntries);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (1)
95unreachableValues ??= new HashSet<string>(StringComparer.Ordinal);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (2)
44var uniqueValues = new HashSet<string>(values.Length, ignoreCase ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal); 403uniqueValues ??= new HashSet<string>(1, ignoreCase ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal) { value };
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
1954HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length);
src\System\RuntimeType.CoreCLR.cs (1)
1029var al = new HashSet<RuntimeType>();
System.Private.CoreLib.Generators (6)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (5)
139HashSet<INamedTypeSymbol> namedTypesToBeProtected = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 399HashSet<INamedTypeSymbol> examinedSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 427HashSet<INamedTypeSymbol> examinedSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 568HashSet<INamedTypeSymbol> notTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 606HashSet<ISymbol> foundSymbols = new HashSet<ISymbol>(SymbolEqualityComparer.Default);
NativeRuntimeEventSourceGenerator.cs (1)
175var usedKeywords = new HashSet<string>();
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\DataContract.cs (4)
1112previousCollectionTypes ??= new HashSet<Type>(); 1229return GetXmlName(type, new HashSet<Type>(), out hasDataContract); 1359return GetCollectionXmlName(type, itemType, new HashSet<Type>(), out collectionContractAttribute); 2072return Equals(obj, new HashSet<DataContractPairKey>());
System.Private.Windows.Core (1)
System\Private\Windows\Ole\DataStore.cs (1)
153HashSet<string> distinctFormats = new(definedCount);
System.Private.Xml (8)
src\libraries\Common\src\System\CSharpHelpers.cs (1)
14private static readonly HashSet<string> s_fixedStringLookup = new HashSet<string>()
System\Xml\Core\XmlTextReaderImpl.cs (1)
8079_currentEntities ??= new HashSet<IDtdEntityInfo>();
System\Xml\Dom\XmlLoader.cs (1)
688HashSet<string> prefixes = new HashSet<string>();
System\Xml\Serialization\XmlSerializationILGen.cs (2)
33private readonly HashSet<TypeMapping> _generatedMethods = new HashSet<TypeMapping>(); 239var uniqueTypes = new HashSet<Type>();
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
1077var cases = new HashSet<string>();
System\Xml\Serialization\XmlSerializationWriter.cs (1)
566var qnIndexes = new HashSet<int>();
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
618var values = new HashSet<long>();
System.Private.Xml.Linq (1)
System\Xml\Schema\XNodeValidator.cs (1)
156schemaInfos ??= new HashSet<XmlSchemaInfo>(new XmlSchemaInfoEqualityComparer());
System.Reflection.DispatchProxy (1)
System\Reflection\DispatchProxyGenerator.cs (1)
115private readonly HashSet<string> _ignoresAccessAssemblyNames = new HashSet<string>();
System.Reflection.Emit (2)
System\Reflection\Emit\EventBuilderImpl.cs (1)
40_otherMethods ??= new HashSet<MethodBuilder>();
System\Reflection\Emit\PropertyBuilderImpl.cs (1)
53_otherMethods ??= new HashSet<MethodInfo>();
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
213HashSet<RoType> ifcs = new HashSet<RoType>();
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\ContractCodeDomInfo.cs (1)
52return _memberNames ??= new HashSet<string>(StringComparer.OrdinalIgnoreCase);
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\SignedCms.cs (1)
563var certs = new HashSet<X509Certificate2>(Certificates.OfType<X509Certificate2>());
System.ServiceModel.Syndication (1)
System\ServiceModel\Syndication\SyndicationFeed.cs (1)
15private static readonly HashSet<string> s_acceptedDays = new HashSet<string>(
System.Text.Json (3)
System\Text\Json\Document\JsonDocument.PropertyNameSet.cs (2)
55_hashSet = new HashSet<ReadOnlyMemory<byte>>( 115_hashSet ??= new HashSet<ReadOnlyMemory<byte>>(
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
43jsonTypeInfo.CreateObject = () => new HashSet<TElement>();
System.Text.Json.SourceGeneration (3)
JsonSourceGenerator.Parser.cs (3)
42private readonly HashSet<(string ContextName, string TypeName)> _generatedContextAndTypeNames = new(); 1530if (!(memberInitializerNames ??= new()).Add(property.MemberName)) 1822HashSet<ITypeSymbol> builtInSupportTypes = new(SymbolEqualityComparer.Default);
System.Text.RegularExpressions (11)
System\Text\RegularExpressions\RegexCharClass.cs (1)
334var whitespaceSet = new HashSet<char>(s_whitespaceChars);
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (5)
33(results._inLoops ??= new HashSet<RegexNode>()).Add(node); 52(results._mayBacktrack ??= new HashSet<RegexNode>()).Add(node); 135(results._mayBacktrack ??= new HashSet<RegexNode>()).Add(node); 158internal readonly HashSet<RegexNode> _isAtomicByAncestor = new(); // since the root is implicitly atomic, every tree will contain atomic-by-ancestor nodes 160internal readonly HashSet<RegexNode> _containsCapture = new(); // the root is a capture, so this will always contain at least the root node
System\Text\RegularExpressions\Symbolic\BDD.cs (2)
251var visited = new HashSet<BDD>(); 458var visited = new HashSet<BDD>();
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
161HashSet<SymbolicRegexNode<TSet>> seenElems = new();
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Explore.cs (1)
19HashSet<MatchingState<TSet>> seen = new();
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (1)
1822var sets = new HashSet<TSet>();
System.Text.RegularExpressions.Generator (12)
RegexGenerator.Emitter.cs (4)
569var additionalDeclarations = new HashSet<string>(); 722var additionalDeclarations = new HashSet<string>(); 1491HashSet<string> additionalDeclarations = new(); 1713var seenChars = new HashSet<char>();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (1)
334var whitespaceSet = new HashSet<char>(s_whitespaceChars);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (5)
33(results._inLoops ??= new HashSet<RegexNode>()).Add(node); 52(results._mayBacktrack ??= new HashSet<RegexNode>()).Add(node); 135(results._mayBacktrack ??= new HashSet<RegexNode>()).Add(node); 158internal readonly HashSet<RegexNode> _isAtomicByAncestor = new(); // since the root is implicitly atomic, every tree will contain atomic-by-ancestor nodes 160internal readonly HashSet<RegexNode> _containsCapture = new(); // the root is a capture, so this will always contain at least the root node
UpgradeToGeneratedRegexAnalyzer.cs (2)
52new HashSet<string> { "Count", "EnumerateMatches", "IsMatch", "Match", "Matches", "Split", "Replace" }); 68HashSet<IMethodSymbol> hash = new HashSet<IMethodSymbol>(SymbolEqualityComparer.Default);
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonMenuItemsPanel.cs (1)
260HashSet<UIElement> targets = new HashSet<UIElement>();
System.Windows.Forms (2)
System\Windows\Forms\Application.cs (1)
986HashSet<Form> processedForms = new(s_forms.Count);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1044HashSet<Type>? typesWithEvents = _selectedObjects.Length > 10 ? new() : null;
System.Windows.Forms.Design (2)
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
1035HashSet<string> memberHash = new(StringComparer.CurrentCultureIgnoreCase);
System\Windows\Forms\Design\ControlCommandSet.cs (1)
297HashSet<Control> itemHash = new(sel.Count);
System.Windows.Forms.Design.Tests (1)
SerializableAttributeTests.cs (1)
15new HashSet<string>
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
207HashSet<ITypeSymbol> foundTypes = new(SymbolEqualityComparer.Default);
System.Windows.Forms.Tests (1)
SerializableAttributeTests.cs (1)
16new HashSet<string>
System.Windows.Input.Manipulations (1)
System\Windows\Input\Manipulations\ManipulationSequence.cs (1)
302? new HashSet<int>(this.manipulatorStates.Keys)
System.Xaml (10)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
1995_names = new HashSet<string>();
System\Xaml\Context\NameFixupGraph.cs (1)
46_uninitializedObjectsAtParseEnd = new HashSet<object>(referenceComparer);
System\Xaml\Context\ObjectWriterContext.cs (1)
242HashSet<string> keys = new HashSet<string>();
System\Xaml\Context\ObjectWriterFrame.cs (2)
36_assignedProperties = new HashSet<XamlMember>(source.AssignedProperties); 191_assignedProperties = new HashSet<XamlMember>();
System\Xaml\Context\XamlParserContext.cs (1)
83HashSet<string> keys = new HashSet<string>();
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
460HashSet<string> visited = new HashSet<string>();
System\Xaml\XamlObjectReader.cs (3)
73namesInCurrentScope.Push(new HashSet<string>()); 225namesInCurrentScope.Push(new HashSet<string>()); 1071HashSet<string> namesOfAttributableProperties = new HashSet<string>();
TaskUsageLogger (3)
TaskUsageLogger.cs (3)
74_tasks = new HashSet<TaskData>(); 202HashSet<UsingTaskData> usingTasks = new HashSet<UsingTaskData>(); 222usingTasks = new HashSet<UsingTaskData>();
Templates.Blazor.Tests (2)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Blazor.WebAssembly.Tests (2)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Mvc.Tests (2)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Tests (2)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Test.Utilities (21)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
TestDiscoveryWorker (1)
Program.cs (1)
79var testsToWrite = new HashSet<string>();
Text.Analyzers (31)
CodeAnalysisDictionary.cs (2)
53_recognizedWords = new HashSet<string>(recognizedWords, StringComparer.OrdinalIgnoreCase); 54_unrecognizedWords = new HashSet<string>(unrecognizedWords, StringComparer.OrdinalIgnoreCase);
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (3)
142return new HashSet<T>(source, comparer); 152return source as ISet<T> ?? new HashSet<T>(source); 306set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
119public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
23return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
44new(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20); 50new(() => new HashSet<string>(StringComparer.Ordinal), 20);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (1)
16var visited = new HashSet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
99symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
xunit.assert (10)
CollectionAsserts.cs (1)
334 var set = new HashSet<T>(comparer);
Sdk\AssertHelper.cs (2)
381 VerifyEquivalence(expected, actual, strict, string.Empty, new HashSet<object>(referenceEqualityComparer), new HashSet<object>(referenceEqualityComparer), 1);
Sdk\CollectionTracker.cs (5)
201 var dictionaryYKeys = new HashSet<object>(dictionaryY.Keys.Cast<object>()); 344 var setX = new HashSet<object>(enumX.Cast<object>()); 345 var setY = new HashSet<object>(enumY.Cast<object>()); 364 setX = new HashSet<T>(setX, itemComparer); 365 setY = new HashSet<T>(setY, itemComparer);
StringAsserts.cs (2)
1628 static readonly HashSet<char> charsLineEndings = new HashSet<char>() 1633 static readonly HashSet<char> charsWhitespace = new HashSet<char>()
3833 references to HashSet
AnalyzerRunner (3)
CodeRefactoringRunner.cs (1)
178var refactoringTypes = new HashSet<Type>();
DiagnosticAnalyzerRunner.cs (2)
209var uniqueLines = new HashSet<string>(); 257var analyzerTypes = new HashSet<Type>();
aspire (1)
Commands\ExecCommand.cs (1)
291var knownOptions = new HashSet<string>(Options.SelectMany(o => o.Aliases));
Aspire.Dashboard (13)
Components\Controls\ResourceDetails.razor.cs (1)
54private readonly HashSet<string> _unmaskedItemNames = new();
Components\Dialogs\TextVisualizerDialog.razor.cs (1)
35public HashSet<string?> EnabledOptions { get; } = [];
Components\Pages\Resources.razor.cs (4)
99private readonly HashSet<string> _collapsedResourceNames = new(StringComparers.ResourceName); 304var preselectedHiddenResourceTypes = HiddenTypes?.Split(' ').Select(StringUtils.Unescape).ToHashSet(); 305var preselectedHiddenResourceStates = HiddenStates?.Split(' ').Select(StringUtils.Unescape).ToHashSet(); 306var preselectedHiddenResourceHealthStates = HiddenHealthStates?.Split(' ').Select(StringUtils.Unescape).ToHashSet();
Components\Pages\TraceDetail.razor.cs (2)
105var visibleViewModels = new HashSet<SpanWaterfallViewModel>(); 231var apps = new HashSet<OtlpApplication>();
Model\DashboardCommandExecutor.cs (1)
24private readonly HashSet<(string ResourceName, string CommandName)> _executingCommands = [];
Model\DimensionFilterViewModel.cs (1)
16public HashSet<DimensionValueViewModel> SelectedValues { get; } = new();
Otlp\Storage\TelemetryRepository.cs (2)
45private readonly HashSet<(OtlpApplication Application, string PropertyKey)> _logPropertyKeys = new(); 46private readonly HashSet<(OtlpApplication Application, string PropertyKey)> _tracePropertyKeys = new();
Utils\MarkdownHelpers.cs (1)
15private static readonly HashSet<string> s_allowedSchemes = new HashSet<string>(StringComparers.EndpointAnnotationUriScheme) { "http", "https", "mailto" };
Aspire.Hosting (14)
ApplicationModel\EndpointReferenceAnnotation.cs (1)
13public HashSet<string> EndpointNames { get; } = new(StringComparers.EndpointAnnotationName);
Dashboard\DashboardLifecycleHook.cs (2)
42private static readonly HashSet<string> s_suppressAutomaticConfigurationCopy = new HashSet<string>(StringComparer.OrdinalIgnoreCase) 330var corsOrigins = new HashSet<string>(StringComparers.UrlHost);
Dcp\DcpExecutor.cs (1)
837var serviceNames = new HashSet<string>();
Dcp\DcpNameGenerator.cs (2)
80public string GetServiceName(IResource resource, EndpointAnnotation endpoint, bool hasMultipleEndpoints, HashSet<string> allServiceNames) 89private static string GenerateUniqueServiceName(HashSet<string> serviceNames, string candidateName)
Dcp\ResourceSnapshotBuilder.cs (1)
207var serviceEndpoints = new HashSet<(string EndpointName, string ServiceMetadataName)>(resourceServices.Where(s => !string.IsNullOrEmpty(s.EndpointName)).Select(s => (s.EndpointName!, s.Metadata.Name)));
DistributedApplicationBuilder.cs (1)
450var healthCheckRegistrationKeys = options.Registrations.Select(hcr => hcr.Name).ToHashSet();
Publishing\ManifestPublishingContext.cs (2)
46private readonly HashSet<object?> _currentDependencySet = []; 404var httpSchemesEncountered = new HashSet<string>();
Publishing\PublisherAdvertisementEvent.cs (1)
16private readonly HashSet<PublisherAdvertisement> _advertisements = [];
ResourceBuilderExtensions.cs (1)
1984var processed = new HashSet<object>();
ResourceLoggerForwarderService.cs (1)
39var loggingResourceIds = new HashSet<string>();
src\Shared\PortAllocator.cs (1)
16private readonly HashSet<int> _usedPorts = [];
Aspire.Hosting.Azure (9)
AzurePublishingContext.cs (1)
385private static void Visit(object? value, Action<object> visitor, HashSet<object> visited)
AzureResourcePreparer.cs (8)
106var globalRoleAssignments = new Dictionary<AzureProvisioningResource, HashSet<RoleDefinition>>(); 142var azureReferences = await GetAzureReferences(resource, cancellationToken).ConfigureAwait(false); 362private async Task<HashSet<IAzureResource>> GetAzureReferences(IResource resource, CancellationToken cancellationToken) 364HashSet<IAzureResource> azureReferences = []; 399private static void ProcessAzureReferences(HashSet<IAzureResource> azureReferences, object value) 465private static void AppendGlobalRoleAssignments(Dictionary<AzureProvisioningResource, HashSet<RoleDefinition>> globalRoleAssignments, AzureProvisioningResource azureResource, IEnumerable<RoleDefinition> newRoles) 467if (!globalRoleAssignments.TryGetValue(azureResource, out var existingRoles)) 476private void CreateGlobalRoleAssignments(DistributedApplicationModel appModel, Dictionary<AzureProvisioningResource, HashSet<RoleDefinition>> globalRoleAssignments, AzureProvisioningOptions provisioningOptions)
Aspire.Hosting.Azure.AIFoundry (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.AppConfiguration (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.AppContainers (2)
ContainerAppContext.cs (2)
247var httpSchemesEncountered = new HashSet<string>(); 827private readonly HashSet<int> _usedPorts = [];
Aspire.Hosting.Azure.CognitiveServices (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.ContainerRegistry (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.EventHubs (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Functions (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.KeyVault (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Search (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.ServiceBus (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.SignalR (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.Storage (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Azure.WebPubSub (1)
src\Shared\AzureRoleAssignmentUtils.cs (1)
25private static HashSet<RoleDefinition> CreateRoleDefinitions<TBuiltInRole>(IReadOnlyList<TBuiltInRole> roles, Func<TBuiltInRole, string> getName)
Aspire.Hosting.Docker (5)
DockerComposeServiceResource.cs (3)
21private static readonly HashSet<string> s_shellExecutables = new(StringComparer.OrdinalIgnoreCase) 222var ports = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 223var expose = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
EnvFile.cs (1)
9private readonly HashSet<string> _keys = [];
src\Shared\PortAllocator.cs (1)
16private readonly HashSet<int> _usedPorts = [];
Aspire.Hosting.Kubernetes (2)
Extensions\ResourceExtensions.cs (2)
74var processedKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 105var processedKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Aspire.Hosting.Sdk.Tests (2)
src\Aspire.AppHost.Sdk\Aspire.RuntimeIdentifier.Tool\NuGetUtils.cs (2)
32HashSet<string> availableRids = new(availableRuntimeIdentifiers, StringComparer.Ordinal); 33HashSet<string>? excludedRids = runtimeIdentifiersToExclude switch { null => null, _ => new HashSet<string>(runtimeIdentifiersToExclude, StringComparer.Ordinal) };
Aspire.Hosting.Testing.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
127var loggingResourceIds = new HashSet<string>();
Aspire.Hosting.Tests (4)
Dcp\DcpExecutorTests.cs (1)
93var resourceIds = new HashSet<string>();
DistributedApplicationTests.cs (2)
958var expectedExeResources = new HashSet<string>() 967var expectedContainerResources = new HashSet<string>()
Utils\LoggerNotificationExtensions.cs (1)
127var loggingResourceIds = new HashSet<string>();
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientInstrumentation.cs (1)
25private static readonly HashSet<string> DiagnosticSourceEvents = new()
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientInstrumentation.cs (1)
25private static readonly HashSet<string> DiagnosticSourceEvents = new()
Aspire.Playground.Tests (2)
Infrastructure\DistributedApplicationExtensions.cs (1)
57var seenVolumes = new HashSet<string>();
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
127var loggingResourceIds = new HashSet<string>();
Aspire.RuntimeIdentifier.Tool (2)
NuGetUtils.cs (2)
32HashSet<string> availableRids = new(availableRuntimeIdentifiers, StringComparer.Ordinal); 33HashSet<string>? excludedRids = runtimeIdentifiersToExclude switch { null => null, _ => new HashSet<string>(runtimeIdentifiersToExclude, StringComparer.Ordinal) };
Aspire.Templates.Tests (1)
TemplateTestsBase.cs (1)
183HashSet<string> foundNames = [];
BoundTreeGenerator (1)
BoundNodeClassWriter.cs (1)
33private HashSet<string> _valueTypes;
BuildBoss (7)
CompilerNuGetCheckerUtil.cs (4)
238var foundSet = new HashSet<string>(PathComparer); 363var excludedNameSet = new HashSet<string>(PathComparer) 375var foundDllNameSet = new HashSet<string>(PathComparer); 376var neededDllNameSet = new HashSet<string>(PathComparer);
OptProfCheckerUtil.cs (2)
73var manifestFileNames = GetManifestFileNames(textWriter, vsixFullPath); 97private static HashSet<string> GetManifestFileNames(TextWriter textWriter, string vsixFullPath)
SolutionCheckerUtil.cs (1)
147var set = new HashSet<string>();
BuildValidator (1)
LocalReferenceResolver.cs (1)
40private readonly HashSet<DirectoryInfo> _indexDirectories = new();
CodeGenerator (1)
HttpUtilities\HttpUtilitiesGeneratorHelpers.cs (1)
81var mashHash = new HashSet<ulong>();
ConfigurationSchemaGenerator (5)
RuntimeSource\Configuration.Binder\Parser\KnownTypeSymbols.cs (1)
108HashSet = compilation.GetBestTypeByMetadataName(typeof(HashSet<>));
RuntimeSource\Configuration.Binder\Specs\BindingHelperInfo.cs (4)
32private readonly Dictionary<MethodsToGen_CoreBindingHelper, HashSet<TypeSpec>> _typesForGen = new(); 62_typesForGen.TryGetValue(overload, out HashSet<TypeSpec>? typesAsBase); 70? (HashSet<TSpec>)(object)typesAsBase 209if (!_typesForGen.TryGetValue(method, out HashSet<TypeSpec>? types))
Crossgen2Tasks (5)
CommonFilePulledFromSdkRepo\NuGetUtils.NuGet.cs (1)
88HashSet<string> availableRids = new HashSet<string>(availableRuntimeIdentifiers);
PrepareForReadyToRunCompilation.cs (4)
111var exclusionSet = ExcludeList == null || Crossgen2Composite ? null : new HashSet<string>(ExcludeList, StringComparer.OrdinalIgnoreCase); 112var compositeExclusionSet = PublishReadyToRunCompositeExclusions == null || !Crossgen2Composite ? null : new HashSet<string>(PublishReadyToRunCompositeExclusions, StringComparer.OrdinalIgnoreCase); 355private static Eligibility GetInputFileEligibility(ITaskItem file, bool compositeCompile, HashSet<string> exclusionSet, HashSet<string> r2rCompositeExclusionSet)
CSharpSyntaxGenerator (2)
SourceWriter.cs (2)
1599var factoryWithNoAutoCreatableTokenFields = new HashSet<Field>(DetermineRedFactoryWithNoAutoCreatableTokenFields(nd)); 1682var minimalFactoryfields = new HashSet<Field>(DetermineMinimalFactoryFields(nd));
dotnet-dev-certs (3)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
dotnet-svcutil-lib (11)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (6)
1286private static bool IsTypeSerializable(Type type, HashSet<Type> previousCollectionTypes) 1313private static void ValidatePreviousCollectionTypes(Type collectionType, Type itemType, HashSet<Type> previousCollectionTypes) 1419internal static XmlQualifiedName GetStableName(Type type, HashSet<Type> previousCollectionTypes, out bool hasDataContract) 1473private static XmlQualifiedName GetNonDCTypeStableName(Type type, HashSet<Type> previousCollectionTypes) 1498private static bool TryGetBuiltInXmlAndArrayTypeStableName(Type type, HashSet<Type> previousCollectionTypes, out XmlQualifiedName stableName) 1577internal static XmlQualifiedName GetCollectionStableName(Type type, Type itemType, HashSet<Type> previousCollectionTypes, out CollectionDataContractAttribute collectionContractAttribute)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CommunicationObjectManager.cs (1)
12private HashSet<ItemType> _table;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (1)
18internal static HashSet<string> WellKnownContentHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (1)
35private static readonly HashSet<char> s_InvalidSeparatorSet = new HashSet<char>(new char[] { '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}', ' ' });
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (1)
418private HashSet<IChannel> _hashSet = new HashSet<IChannel>();
ImportModule.cs (1)
406private readonly HashSet<ContractDescription> _httpBindingContracts = new HashSet<ContractDescription>();
dotnet-user-jwts (1)
Helpers\DevJwtCliHelpers.cs (1)
76var applicationUrls = new HashSet<string>();
GenerateDocumentationAndConfigFiles (71)
Program.cs (2)
268var fixableDiagnosticIds = new HashSet<string>(); 269var categories = new HashSet<string>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
illink (75)
ILLink.RoslynAnalyzer (4)
DataFlow\DynamicallyAccessedMembersBinder.cs (1)
418private static void GetAllOnType(ITypeSymbol type, bool declaredOnly, List<ISymbol> members, HashSet<ITypeSymbol> types)
DataFlow\LValueFlowCaptureProvider.cs (1)
61var rvalueFlowCaptureIds = new HashSet<CaptureId>();
ISymbolExtensions.cs (1)
86HashSet<string> featureSet = new();
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
80var values = new HashSet<DynamicallyAccessedMemberTypes>(
ILLink.Tasks (6)
CreateRuntimeRootDescriptorFile.cs (5)
57public HashSet<string> methods; 58public HashSet<string> fields; 98readonly HashSet<string> defineConstants = new HashSet<string>(StringComparer.Ordinal); 561readonly HashSet<string> defineConstants; 567public DefineTracker(HashSet<string> defineConstants, TaskLoggingHelper log, string filePath)
LinkTask.cs (1)
360HashSet<string> assemblyNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Infrastructure.Common (3)
xunit\IssueAttribute.cs (3)
26private static HashSet<int> s_includeIssuesHash = DetectIssuesToInclude(); 95private static HashSet<int> DetectIssuesToInclude() 117HashSet<int> hashSet = new HashSet<int>();
InMemory.FunctionalTests (1)
Http2\Http2TestBase.cs (1)
133protected readonly HashSet<int> _abortedStreamIds = new HashSet<int>();
installer.tasks (2)
FileUtilities.cs (1)
14private static readonly HashSet<string> s_assemblyExtensions = new HashSet<string>(
GenerateTestSharedFrameworkDepsFile.cs (1)
45var ignoredExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Interop.FunctionalTests (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
22private readonly HashSet<DiagnosticPoolBlock> _blocks;
InteropTests (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
IOperationGenerator (2)
IOperationClassWriter.cs (2)
493var newProps = new HashSet<string>(StringComparer.Ordinal); 961var newProps = new HashSet<string>(StringComparer.Ordinal);
KeyManagementSimulator (2)
Program.cs (2)
319private HashSet<Guid> _knownKeyIds; // As of _now 403var knownKeyIds = _knownKeyIds;
Metrics (58)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Metrics.Legacy (58)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Microsoft.Analyzers.Extra (5)
AsyncMethodWithoutCancellation.cs (2)
49var knownTypes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 154private static bool MethodParametersContainKnownTypes(IMethodSymbol method, HashSet<ITypeSymbol> typeSymbols)
CallAnalysis\CallAnalyzer.State.cs (1)
21public readonly HashSet<string> InterfaceMethodNames = [];
MakeExeTypesInternalAnalyzer.cs (2)
59var disqualifyingMemberAttributes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 69var disqualifyingTypeAttributes = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
Microsoft.Analyzers.Extra.Tests (1)
SyntaxNodeExtensionsTests.cs (1)
88var typesToStopTraversing = new HashSet<Type>
Microsoft.Analyzers.Local (9)
ApiLifecycle\AssemblyAnalysis.cs (8)
16public HashSet<TypeDef> MissingTypes { get; } = []; 19public HashSet<Method> MissingMethods { get; } = []; 20public HashSet<Prop> MissingProperties { get; } = []; 21public HashSet<Field> MissingFields { get; } = []; 22public HashSet<(ISymbol symbol, Stage stage)> FoundInBaseline { get; } = []; 23public HashSet<ISymbol> NotFoundInBaseline { get; } = new(SymbolEqualityComparer.Default); 141var baseTypes = new HashSet<string>(type.AllInterfaces.Select(x => x.ToDisplayString(_shortSymbolNameFormat))); 176var constraints = new HashSet<string>(Utils.GetConstraints(typeSignature));
CallAnalysis\CallAnalyzer.State.cs (1)
21public readonly HashSet<string> InterfaceMethodNames = [];
Microsoft.Arcade.Test.Common (3)
AssertEx.cs (2)
244var expectedSet = new HashSet<T>(expected, comparer); 259var expectedSet = new HashSet<T>(expected);
MockFileSystem.cs (1)
16public HashSet<string> Directories { get; }
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticVerifier.cs (1)
73var projects = new HashSet<Project>();
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
20var seen = new HashSet<string>();
Microsoft.AspNetCore.App.Analyzers (6)
Infrastructure\RoutePattern\RoutePatternParser.cs (3)
71var seenDiagnostics = new HashSet<EmbeddedDiagnostic>(); 315private static void CollectDiagnostics(RoutePatternNode node, HashSet<EmbeddedDiagnostic> seenDiagnostics, IList<EmbeddedDiagnostic> diagnostics) 337HashSet<EmbeddedDiagnostic> seenDiagnostics, ImmutableArray<EmbeddedDiagnostic> from, IList<EmbeddedDiagnostic> to)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
480private readonly HashSet<string> _names = new(StringComparer.OrdinalIgnoreCase);
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
71var routeParameterNames = new HashSet<string>(routeUsage.RoutePattern.RouteParameters.Select(p => p.Name), StringComparer.OrdinalIgnoreCase);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
328private readonly HashSet<string> _names = new();
Microsoft.AspNetCore.App.UnitTests (22)
SharedFxTests.cs (9)
37var actualAssemblies = Directory.GetFiles(_sharedFxRoot, "*.dll") 61var actualAssemblies = Directory.GetFiles(_sharedFxRoot, "*.dll") 64var expectedAssemblies = TestData.GetSharedFxDependencies() 164var repoAssemblies = TestData.GetSharedFrameworkBinariesFromRepo() 218var repoAssemblies = TestData.GetSharedFrameworkBinariesFromRepo() 261var expectedAssemblies = TestData.GetSharedFxDependencies() 276var actualAssemblies = runtimeListEntries 332var actualPaths = archive.Entries 336var expectedPaths = runtimeListEntries.Select(i => i.Attribute("Path").Value).ToHashSet();
TargetingPackTests.cs (13)
38var actualAssemblies = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll") 41var listedTargetingPackAssemblies = TestData.ListedTargetingPackAssemblies.ToHashSet(); 64var repoAssemblies = TestData.GetAspNetCoreTargetingPackDependencies() 140var runtimeDependencies = TestData.GetRuntimeTargetingPackDependencies() 143var aspnetcoreDependencies = TestData.GetAspNetCoreTargetingPackDependencies() 228var expectedAssemblies = TestData.GetSharedFxDependencies() 248var actualAssemblies = manifestFileLines 293var expectedAssemblies = TestData.GetTargetingPackDependencies() 306var expectedAnalyzers = Directory.Exists(analyzersDir) ? 316void CompareFrameworkElements(HashSet<string> expectedAssemblyNames, IEnumerable<XElement> actualElements, string type) 323var actualAssemblyNames = managedEntries 375var actualPaths = archive.Entries 379var expectedPaths = frameworkListEntries.Select(i => i.Attribute("Path").Value).ToHashSet();
Microsoft.AspNetCore.Authentication.Core (1)
AuthenticationService.cs (1)
16private HashSet<ClaimsPrincipal>? _transformCache;
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\LdapAdapter.cs (1)
101private static void GetNestedGroups(LdapConnection connection, ClaimsIdentity principal, string distinguishedName, string groupCN, ILogger logger, IList<string> retrievedClaims, HashSet<string> processedGroups)
Microsoft.AspNetCore.Authorization (1)
AuthorizationHandlerContext.cs (1)
17private readonly HashSet<IAuthorizationRequirement> _pendingRequirements;
Microsoft.AspNetCore.BrowserTesting (8)
BrowserManagerConfiguration.cs (8)
216private static T BindMultiValueMap<T>(IConfigurationSection processArgsMap, Func<Dictionary<string, HashSet<string>>, T> mapper) 233return mapper(new Dictionary<string, HashSet<string>>()); 235var argsMap = new Dictionary<string, HashSet<string>>(); 247var argValues = InitializeMapValue(argsMap, argName); 264var argValue = InitializeMapValue(argsMap, argName); 284static HashSet<string> InitializeMapValue(Dictionary<string, HashSet<string>> argsMap, string argName) 286if (!argsMap.TryGetValue(argName, out var argValue))
Microsoft.AspNetCore.Components (20)
CascadingValue.cs (1)
14private HashSet<ComponentState>? _subscribers; // Lazily instantiated
NavigationManager.cs (1)
411var locationChangingTasks = new HashSet<Task>();
ResourceAssetCollection.cs (1)
30var contentSpecificUrls = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Routing\RouteKey.cs (1)
11public readonly HashSet<Assembly>? AdditionalAssemblies;
Routing\RouteTableFactory.cs (11)
132var allRouteParameterNames = result.AllRouteParameterNames; 152var parameterNames = GetParameterNames(parsedTemplate); 166public HashSet<string> AllRouteParameterNames { get; set; } = new(StringComparer.OrdinalIgnoreCase); 167public (RoutePattern, HashSet<string>)[] ParsedTemplates { get; set; } = new (RoutePattern, HashSet<string>)[templates.Length]; 176HashSet<string>? routeParameterNames = null; 202var seen = new HashSet<InboundRouteEntry>(new InboundRouteEntryAmbiguityEqualityComparer()); 224private static HashSet<string> GetParameterNames(RoutePattern routeTemplate) 226var parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 235private static List<string>? GetUnusedParameterNames(HashSet<string> allRouteParameterNames, HashSet<string> routeParameterNames)
Routing\SupplyParameterFromQueryValueProvider.cs (2)
14private HashSet<ComponentState>? _subscribers; 15private HashSet<ComponentState>? _pendingSubscribers;
src\Http\Routing\src\Patterns\RoutePatternParser.cs (2)
481private readonly HashSet<string> _parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 504public HashSet<string> ParameterNames
src\Http\Routing\src\RouteConstraintBuilder.cs (1)
28private readonly HashSet<string> _optionalParameters;
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
53var projects = new HashSet<Project>();
Microsoft.AspNetCore.Components.Authorization.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.Endpoints (18)
Discovery\ComponentApplicationBuilder.cs (1)
14private readonly HashSet<string> _assemblies = new();
Discovery\RazorComponentApplication.cs (1)
39var set = new HashSet<IComponentRenderMode>();
FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (2)
188CreateConverter<IReadOnlySet<TElement>, HashSet<TElement>>(elementTypeConverter), 194CreateConverter<ISet<TElement>, HashSet<TElement>>(elementTypeConverter),
FormMapping\FormDataReader.cs (9)
26private IReadOnlyDictionary<FormKey, HashSet<FormKey>>? _formDictionaryKeysByPrefix; 115if (_formDictionaryKeysByPrefix.TryGetValue(new FormKey(_currentPrefixBuffer), out var foundKeys)) 124internal IReadOnlyDictionary<FormKey, HashSet<FormKey>> ProcessFormKeys() 127var result = new Dictionary<FormKey, HashSet<FormKey>>(); 149if (result.TryGetValue(new FormKey(prefix), out var foundKeys)) 289private readonly HashSet<FormKey> _values; 294public FormKeyCollection(HashSet<FormKey> values) => _values = values; 304private HashSet<FormKey>.Enumerator _enumerator; 306public Enumerator(HashSet<FormKey>.Enumerator enumerator)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (4)
23private readonly Dictionary<string, HashSet<(int ComponentId, int FrameIndex)>> _namedSubmitEventsByScopeQualifiedName = new(StringComparer.Ordinal); 35if (!_namedSubmitEventsByScopeQualifiedName.TryGetValue(handlerName, out var locationsForName) || locationsForName.Count == 0) 165var locationsForName = _namedSubmitEventsByScopeQualifiedName[scopeQualifiedName]; 188var locationsForName = GetOrAddNewToDictionary(_namedSubmitEventsByScopeQualifiedName, scopeQualifiedName);
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
22private HashSet<int>? _visitedComponentIdsInCurrentStreamingBatch;
Microsoft.AspNetCore.Components.Endpoints.Tests (8)
Binding\FormDataMapperTests.cs (7)
657var expected = new HashSet<int> { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; 658CanDeserialize_Collection<IReadOnlySet<int>, HashSet<int>, int>(expected); 681var expected = new HashSet<int> { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; 682CanDeserialize_Collection<ISet<int>, HashSet<int>, int>(expected); 729var expected = new HashSet<int> { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; 730CanDeserialize_Collection<HashSet<int>, HashSet<int>, int>(expected);
ImportMapTest.cs (1)
277private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.Forms (1)
FieldState.cs (1)
14private HashSet<ValidationMessageStore>? _validationMessageStores;
Microsoft.AspNetCore.Components.Forms.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
53var projects = new HashSet<Project>();
Microsoft.AspNetCore.Components.Server (2)
Circuits\ServerComponentDeserializer.cs (2)
68private readonly HashSet<Guid> _expiredInvocationIds = new(); 69private readonly HashSet<int> _seenSequenceNumbersForCurrentInvocation = new();
Microsoft.AspNetCore.Components.Tests (5)
NavigationManagerTest.cs (2)
566var canceledHandlerTaskIds = new HashSet<string>(); 610var canceledHandlerTaskIds = new HashSet<string>();
Routing\RouteTableFactoryTests.cs (2)
127var result = new HashSet<InboundRouteEntry>(); 131void GetRoutes(UrlMatchingNode node, HashSet<InboundRouteEntry> result)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.Web (1)
HtmlRendering\StaticHtmlRenderer.HtmlWriting.cs (1)
14private static readonly HashSet<string> SelfClosingElements = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.Components.Web.Tests (1)
src\Components\Shared\test\TestRenderer.cs (1)
50private HashSet<TestRendererComponentState> UndisposedComponentStates { get; } = new();
Microsoft.AspNetCore.Components.WebAssembly (3)
.packages\microsoft.dotnet.hotreload.agent\10.0.100-preview.7.25358.102\contentFiles\cs\net6.0\MetadataUpdateHandlerInvoker.cs (2)
323var visited = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 330static void Visit(Assembly[] assemblies, Assembly assembly, List<Assembly> sortedAssemblies, HashSet<string> visited)
Hosting\WebAssemblyHostConfiguration.cs (1)
94var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Components.WebView (4)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (4)
53HashSet<IFileInfo>? files = null; 86HashSet<IFileInfo>? GetFilesForCandidatePatterns(string[] segments, StaticWebAssetNode? candidate, HashSet<IFileInfo>? files) 119void GetCandidateFilesForNode(StaticWebAssetNode candidate, HashSet<IFileInfo> files)
Microsoft.AspNetCore.DataProtection (3)
KeyManagement\XmlKeyManager.cs (3)
185HashSet<Guid>? revokedKeyIds = null; 437var allKeyIds = new HashSet<Guid>(); 438var deletedKeyIds = new HashSet<Guid>();
Microsoft.AspNetCore.DataProtection.Tests (3)
Repositories\EphemeralXmlRepositoryTests.cs (1)
78var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Repositories\FileSystemXmlRepositoryTests.cs (1)
183var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Repositories\RegistryXmlRepositoryTests.cs (1)
171var elementSet = new HashSet<string>(repository.GetAllElements().Select(e => e.Name.LocalName));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\LoggingRedactionOptions.cs (1)
88/// The default value is an empty <see cref="HashSet{T}"/>.
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\IncomingHttpDimensionsTests.cs (1)
19var names = new HashSet<string>(dimensions);
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\GrpcProtocolConstants.cs (1)
15internal static readonly HashSet<string> FilteredHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
src\Grpc\JsonTranscoding\src\Shared\DescriptorRegistry.cs (1)
13private readonly HashSet<FileDescriptor> _fileDescriptors = new HashSet<FileDescriptor>();
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
35private static readonly HashSet<string> WellKnownTypeNames = new HashSet<string>
Microsoft.AspNetCore.Grpc.Swagger (2)
src\Grpc\JsonTranscoding\src\Shared\DescriptorRegistry.cs (1)
13private readonly HashSet<FileDescriptor> _fileDescriptors = new HashSet<FileDescriptor>();
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
35private static readonly HashSet<string> WellKnownTypeNames = new HashSet<string>
Microsoft.AspNetCore.Hosting (7)
GenericHost\GenericWebHostBuilder.cs (1)
130var processed = new HashSet<Assembly>();
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (4)
53HashSet<IFileInfo>? files = null; 86HashSet<IFileInfo>? GetFilesForCandidatePatterns(string[] segments, StaticWebAssetNode? candidate, HashSet<IFileInfo>? files) 119void GetCandidateFilesForNode(StaticWebAssetNode candidate, HashSet<IFileInfo> files)
WebHostBuilder.cs (2)
179var assemblyNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 225var processed = new HashSet<Assembly>();
Microsoft.AspNetCore.Http.Extensions (11)
src\Components\Endpoints\src\FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (2)
188CreateConverter<IReadOnlySet<TElement>, HashSet<TElement>>(elementTypeConverter), 194CreateConverter<ISet<TElement>, HashSet<TElement>>(elementTypeConverter),
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (9)
26private IReadOnlyDictionary<FormKey, HashSet<FormKey>>? _formDictionaryKeysByPrefix; 115if (_formDictionaryKeysByPrefix.TryGetValue(new FormKey(_currentPrefixBuffer), out var foundKeys)) 124internal IReadOnlyDictionary<FormKey, HashSet<FormKey>> ProcessFormKeys() 127var result = new Dictionary<FormKey, HashSet<FormKey>>(); 149if (result.TryGetValue(new FormKey(prefix), out var foundKeys)) 289private readonly HashSet<FormKey> _values; 294public FormKeyCollection(HashSet<FormKey> values) => _values = values; 304private HashSet<FormKey>.Enumerator _enumerator; 306public Enumerator(HashSet<FormKey>.Enumerator enumerator)
Microsoft.AspNetCore.Http.Results.Tests (2)
ResultsTests.cs (2)
1709var testedMethods = new HashSet<string>(FactoryMethodsTuples.Select(t => GetMemberName(t.Item1.Body))); 1710var actualMethods = new HashSet<string>(typeof(Results).GetMethods(BindingFlags.Public | BindingFlags.Static)
Microsoft.AspNetCore.HttpLogging (3)
HttpLoggingMiddleware.cs (1)
352HashSet<string> allowedHeaders)
HttpLoggingOptions.cs (2)
32internal HashSet<string> _internalRequestHeaders = new HashSet<string>(26, StringComparer.OrdinalIgnoreCase) 71internal HashSet<string> _internalResponseHeaders = new HashSet<string>(19, StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.InternalTesting (1)
Tracing\CollectingEventListener.cs (1)
18private readonly HashSet<string> _requestedEventSources = new HashSet<string>();
Microsoft.AspNetCore.Mvc.Analyzers (1)
TagHelpersInCodeBlocksAnalyzer.cs (1)
43var capturedDiagnosticLocations = new HashSet<Location>();
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
116var declaredUsings = new HashSet<string>(compilationUnit.Usings.Select(x => x.Name.ToString()));
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
567private HashSet<PropertyKey> Visited { get; }
Microsoft.AspNetCore.Mvc.Core (14)
ApplicationModels\ControllerActionDescriptorProvider.cs (1)
52var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ApplicationParts\ApplicationPartManager.cs (1)
55var seenAssemblies = new HashSet<Assembly>();
ModelBinding\FormValueProvider.cs (1)
17private readonly HashSet<string?>? _invariantValueKeys;
ModelBinding\JQueryFormValueProvider.cs (1)
16private readonly HashSet<string?>? _invariantValueKeys;
ModelBinding\Metadata\DefaultModelMetadata.cs (2)
448var visited = new HashSet<DefaultModelMetadata>(); 462internal static bool CalculateHasValidators(HashSet<DefaultModelMetadata> visited, ModelMetadata metadata)
ModelBinding\Validation\ValidationStack.cs (1)
22internal HashSet<object>? HashSet { get; set; }
Routing\ActionEndpointFactory.cs (4)
40HashSet<string> routeNames, 176HashSet<string> routeNames, 177HashSet<string> keys, 330HashSet<string> routeNames,
Routing\ControllerActionEndpointDataSource.cs (2)
74var keys = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 79var routeNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Routing\KnownRouteValueConstraint.cs (1)
98var values = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\Validation\DefaultObjectValidatorTests.cs (1)
893typeof(HashSet<Uri>)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
ModelMetadataProviderTest.cs (1)
34var matched = new HashSet<string>();
Microsoft.AspNetCore.Mvc.Razor (6)
RazorPage.cs (2)
15private readonly HashSet<string> _renderedSections = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 18private HashSet<string>? _ignoredSections;
RazorViewEngine.cs (4)
191var expirationTokens = new HashSet<IChangeToken>(); 353var expirationTokens = new HashSet<IChangeToken>(); 393HashSet<IChangeToken> expirationTokens, 427HashSet<IChangeToken> expirationTokens)
Microsoft.AspNetCore.Mvc.Razor.Test (2)
RazorViewTest.cs (2)
1750var expected = new HashSet<IRazorPage>(); 1753var activated = new HashSet<IRazorPage>();
Microsoft.AspNetCore.Mvc.RazorPages (2)
ApplicationModels\CompiledPageRouteModelProvider.cs (1)
54var visited = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Infrastructure\PageActionEndpointDataSource.cs (1)
53var routeNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Mvc.TagHelpers (1)
OptionTagHelper.cs (1)
93var allValues = new HashSet<string>(currentValues.Values, StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.Mvc.ViewFeatures (6)
DefaultHtmlGenerator.cs (1)
971var currentValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Rendering\MultiSelectList.cs (2)
150var selectedValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 180var selectedValues = new HashSet<object>();
TempDataDictionary.cs (2)
26private HashSet<string>? _initialKeys; 27private HashSet<string>? _retainedKeys;
TemplateInfo.cs (1)
12private readonly HashSet<object> _visitedObjects;
Microsoft.AspNetCore.OpenApi (5)
Services\OpenApiDocumentService.cs (3)
311var tags = GetTags(description, document); 335private static HashSet<OpenApiTagReference> GetTags(ApiDescription description, OpenApiDocument document) 340HashSet<OpenApiTagReference> tags = [];
Services\OpenApiGenerator.cs (2)
324private HashSet<OpenApiTagReference> GetOperationTags(MethodInfo methodInfo, EndpointMetadataCollection metadata) 331var tags = new HashSet<OpenApiTagReference>();
Microsoft.AspNetCore.OpenApi.SourceGenerators (7)
Helpers\AssemblyTypeSymbolsVisitor.cs (3)
18private readonly HashSet<INamedTypeSymbol> _exportedTypes = new(SymbolEqualityComparer.Default); 19private readonly HashSet<IPropertySymbol> _exportedProperties = new(SymbolEqualityComparer.Default); 20private readonly HashSet<IMethodSymbol> _exportedMethods = new(SymbolEqualityComparer.Default);
XmlComments\XmlComment.InheritDoc.cs (4)
25private static string? GetDocumentationComment(ISymbol symbol, string xmlText, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CancellationToken cancellationToken) 95private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 106private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 142private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken)
Microsoft.AspNetCore.OutputCaching (8)
Memory\MemoryOutputCacheStore.cs (5)
13private readonly Dictionary<string, HashSet<TaggedEntry>> _taggedEntries = []; 24internal Dictionary<string, HashSet<string>> TaggedEntries => _taggedEntries.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Select(t => t.Key).ToHashSet()); 32if (_taggedEntries.TryGetValue(tag, out var keys)) 94if (!_taggedEntries.TryGetValue(tag, out var keys)) 150if (_taggedEntries.TryGetValue(tag, out var tagged))
OutputCacheContext.cs (1)
58public HashSet<string> Tags { get; } = new();
OutputCacheEntryFormatter.cs (2)
38public static async ValueTask StoreAsync(string key, OutputCacheEntry value, HashSet<string>? tags, TimeSpan duration, IOutputCacheStore store, ILogger logger, CancellationToken cancellationToken) 72static ReadOnlyMemory<string> CopyToLeasedMemory(HashSet<string>? tags, out string[]? lease)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
29private static readonly HashSet<string> _tags = new();
Microsoft.AspNetCore.OutputCaching.Tests (3)
MemoryOutputCacheStoreTests.cs (3)
74HashSet<string> tag1s; 180HashSet<string> tag1s, tag2s; 220HashSet<string> tag1s, tag2s;
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
471private HashSet<string> _deletedKeys;
Microsoft.AspNetCore.RateLimiting (1)
DefaultCombinedLease.cs (1)
12private HashSet<string>? _metadataNames;
Microsoft.AspNetCore.ResponseCompression (3)
ResponseCompressionProvider.cs (3)
20private readonly HashSet<string> _mimeTypes; 21private readonly HashSet<string> _excludedMimeTypes; 94var candidates = new HashSet<ProviderCandidate>();
Microsoft.AspNetCore.Routing (7)
DecisionTree\DecisionTreeBuilder.cs (2)
210public HashSet<string> CurrentCriteria { get; private set; } 212public HashSet<ItemDescriptor<TItem>> MatchedItems { get; private set; }
Matching\HttpMethodMatcherPolicy.cs (1)
92HashSet<string>? methods = null;
Patterns\RoutePatternFactory.cs (1)
1073var parameterNameSet = new HashSet<string>(parameterCount, StringComparer.OrdinalIgnoreCase);
Patterns\RoutePatternParser.cs (2)
481private readonly HashSet<string> _parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 504public HashSet<string> ParameterNames
RouteConstraintBuilder.cs (1)
28private readonly HashSet<string> _optionalParameters;
Microsoft.AspNetCore.Server.HttpSys (2)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
22private readonly HashSet<DiagnosticPoolBlock> _blocks;
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
19internal static readonly HashSet<string> DisallowedTrailers = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
22private readonly HashSet<DiagnosticPoolBlock> _blocks;
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
19internal static readonly HashSet<string> DisallowedTrailers = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Microsoft.AspNetCore.Server.Kestrel.Core (10)
Internal\CertificatePathWatcher.cs (5)
75var addSet = new HashSet<CertificateConfig>(certificateConfigsToAdd, ReferenceEqualityComparer.Instance); 76var removeSet = new HashSet<CertificateConfig>(certificateConfigsToRemove, ReferenceEqualityComparer.Instance); 192var configs = fileMetadata.Configs; 227var configs = fileMetadata.Configs; 300public readonly HashSet<CertificateConfig> Configs = new(ReferenceEqualityComparer.Instance);
Internal\Http\HttpHeaders.Generated.cs (1)
282private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>(91, StringComparer.OrdinalIgnoreCase)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
22private readonly HashSet<DiagnosticPoolBlock> _blocks;
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
22private readonly HashSet<DiagnosticPoolBlock> _blocks;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
22private readonly HashSet<DiagnosticPoolBlock> _blocks;
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
19internal static readonly HashSet<string> DisallowedTrailers = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.AspNetCore.SignalR.Core (1)
HubConnectionContext.cs (1)
60internal HashSet<string> GroupNames { get; } = new HashSet<string>();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (5)
RedisHubLifetimeManager.cs (5)
130var groupNames = feature.Groups; 305var groupNames = feature.Groups; 336var groupNames = feature.Groups; 856HashSet<string> Groups { get; } 861public HashSet<string> Groups { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.SignalR.Tests (3)
HubConnectionHandlerTests.cs (3)
1565var excludeSecondClientId = new HashSet<string>(); 1567var excludeThirdClientId = new HashSet<string>(); 1611var secondAndThirdClients = new HashSet<string> {secondClient.Connection.ConnectionId,
Microsoft.AspNetCore.SpaServices.Extensions (3)
Proxying\SpaProxy.cs (3)
22private static readonly HashSet<string> NotForwardedHttpHeaders = new HashSet<string>( 29private static readonly HashSet<string> NotForwardedWebSocketHeaders = new HashSet<string>( 35private static readonly HashSet<string> InvalidH2H3Headers = new HashSet<string>(
Microsoft.Build.Framework (19)
BinaryTranslator.cs (4)
297public void Translate(ref HashSet<string> set) 603public void TranslateDictionary(ref IDictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys) 1106public void Translate(ref HashSet<string> set) 1386public void TranslateDictionary(ref IDictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys)
BuildCheck\BuildCheckEventArgs.cs (2)
91HashSet<DiagnosticSeverity> explicitSeverities = 98HashSet<string> projectNamesWhereEnabled =
BuildCheck\BuildCheckRuleTelemetryData.cs (4)
28HashSet<DiagnosticSeverity> explicitSeverities, 29HashSet<string> projectNamesWhereEnabled, 76public HashSet<DiagnosticSeverity> ExplicitSeverities { get; init; } = []; 77public HashSet<string> ProjectNamesWhereEnabled { get; init; } = [];
BuildCheck\EnumerableExtensions.cs (5)
37public static HashSet<T> NewHashSet<T>(int capacity) 40public static HashSet<T> NewHashSet<T>(IEqualityComparer<T> equalityComparer) 43public static HashSet<T> NewHashSet<T>(int capacity, IEqualityComparer<T>? equalityComparer) 52public static HashSet<T>? ToHashSet<T>(this ICollection<T>? source, IEqualityComparer<T>? equalityComparer = null) 59if (source is HashSet<T> set)
InsertionBehavior.cs (1)
16/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
ITranslator.cs (2)
183void Translate(ref HashSet<string> set); 321void TranslateDictionary(ref IDictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys);
ProjectStartedEventArgs.cs (1)
505HashSet<string> set = EnumerableExtensions.NewHashSet<string>(count, StringComparer.OrdinalIgnoreCase);
Microsoft.Cci.Extensions (21)
Extensions\CSharp\CSharpCciExtensions.cs (2)
140HashSet<ITypeReference> visited = new HashSet<ITypeReference>(); 176HashSet<ITypeReference> visited = new HashSet<ITypeReference>();
Filters\DocIdExcludeListFilter.cs (1)
16private readonly HashSet<string> _docIds;
Filters\DocIdIncludeListFilter.cs (1)
15private readonly HashSet<string> _docIds;
Filters\ExcludeAttributesFilter.cs (1)
11private readonly HashSet<string> _attributeDocIds;
HostEnvironment.cs (3)
27private HashSet<UnresolvedReference<IUnit, AssemblyIdentity>> _unresolvedIdentities; 247HashSet<AssemblyIdentity> consideredIdentities = new HashSet<AssemblyIdentity>(); 689HashSet<string> allPaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Traversers\AssemblyReferenceTraverser.cs (4)
16private HashSet<AssemblyIdentity> _usedAssemblyReferences = new HashSet<AssemblyIdentity>(); 17public HashSet<AssemblyIdentity> UsedAssemblyReferences { get { return _usedAssemblyReferences; } } 56private HashSet<AssemblyIdentity> _aliasedAssemblyReferences = new HashSet<AssemblyIdentity>(); 57public HashSet<AssemblyIdentity> AliasedAssemblyReferences { get { return _aliasedAssemblyReferences; } }
Traversers\DependencyTraverser.cs (5)
16private readonly Dictionary<IDefinition, HashSet<IReference>> _dependencies; 18private readonly HashSet<IReference> _unresolvedDependencies; 23_dependencies = new Dictionary<IDefinition, HashSet<IReference>>(new ReferenceEqualityComparer<IDefinition>()); 30public IDictionary<IDefinition, HashSet<IReference>> Dependencies { get { return _dependencies; } } 197HashSet<IReference> depends;
Traversers\ResolveAllReferencesTraverser.cs (4)
14private Dictionary<IReference, HashSet<IReference>> _missingDependencies; 18_missingDependencies = new Dictionary<IReference, HashSet<IReference>>(new ReferenceEqualityComparer()); 25public IDictionary<IReference, HashSet<IReference>> MissingDependencies { get { return _missingDependencies; } } 110HashSet<IReference> dependents;
Microsoft.CodeAnalysis (105)
AssemblyUtilities.cs (2)
65HashSet<AssemblyIdentity> assemblyDefinitions = new HashSet<AssemblyIdentity>(); 77HashSet<AssemblyIdentity> assemblyReferences = new HashSet<AssemblyIdentity>();
Binding\AbstractLookupSymbolsInfo.cs (7)
26internal ArityEnumerator(int bitVector, HashSet<int>? arities) 159private bool HasUniqueSymbol => _uniqueSymbolOrArities != null && !(_uniqueSymbolOrArities is HashSet<int>); 177var hashSet = _uniqueSymbolOrArities as HashSet<int>; 206return new ArityEnumerator(_arityBitVectorOrUniqueArity, (HashSet<int>?)_uniqueSymbolOrArities); 215var set = (HashSet<int>?)_uniqueSymbolOrArities;
Binding\UseSiteInfo.cs (4)
110private HashSet<DiagnosticInfo>? _diagnostics; 111private HashSet<TAssemblySymbol>? _dependencies; 419static void mergeAndClear<T>(ref HashSet<T>? self, ref HashSet<T>? other)
Collections\HashSetExtensions.cs (3)
13internal static bool IsNullOrEmpty<T>([NotNullWhen(returnValue: false)] this HashSet<T>? hashSet) 18internal static bool InitializeAndAdd<T>([NotNullIfNotNull(parameterName: nameof(item)), NotNullWhen(returnValue: true)] ref HashSet<T>? hashSet, [NotNullWhen(returnValue: true)] T? item) 37internal static bool Any<T>(this HashSet<T> hashSet, Func<T, bool> predicate)
Collections\IdentifierCollection.Collection.cs (2)
58var strs = obj as HashSet<string>;
Collections\IdentifierCollection.cs (4)
79var spellings = (HashSet<string>)value; 126var set = (HashSet<string>)spellings;
Collections\ImmutableHashSetExtensions.cs (1)
15/// <see cref="HashSet{T}"/>.
Collections\OrderedSet.cs (1)
13private readonly HashSet<T> _set;
CommandLine\CommonCompiler.cs (3)
93private readonly HashSet<Diagnostic> _reportedDiagnostics = new HashSet<Diagnostic>(); 500var set = new HashSet<string>(arguments.EmbeddedFiles.Select(f => f.Path)); 1601var filePaths = new HashSet<string>(PathUtilities.Comparer);
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (2)
26private readonly Lazy<HashSet<AssemblyIdentity>> _lazyAvailableReferences; 37_lazyAvailableReferences = new Lazy<HashSet<AssemblyIdentity>>(() => new HashSet<AssemblyIdentity>(
CommandLine\SarifV2ErrorLogger.cs (1)
27private readonly HashSet<string> _diagnosticIdsWithAnySourceSuppressions;
Compilation\Compilation.cs (4)
836var refSet = new HashSet<MetadataReference>(this.ExternalReferences); 1882internal bool FilterAndAppendDiagnostics(DiagnosticBag accumulator, IEnumerable<Diagnostic> incoming, HashSet<int>? exclude, CancellationToken cancellationToken) 2137var uniqueResourceNames = new HashSet<string>(); 2141var uniqueFileNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
DiagnosticAnalyzer\AnalysisResultBuilder.cs (13)
30private readonly HashSet<DiagnosticAnalyzer> _completedAnalyzersForCompilation; 31private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByTree; 32private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSemanticAnalyzersByTree; 33private readonly Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByAdditionalFile; 46_completedSyntaxAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 47_completedSemanticAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 48_completedSyntaxAnalyzersByAdditionalFile = new Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>>(); 105private HashSet<DiagnosticAnalyzer>? GetCompletedAnalyzersForFile_NoLock(SourceOrAdditionalFile filterFile, bool syntax) 110if (completedAnalyzersByTree.TryGetValue(tree, out var completedAnalyzersForTree)) 117if (_completedSyntaxAnalyzersByAdditionalFile.TryGetValue(additionalFile, out var completedAnalyzersForFile)) 132var completedAnalyzers = new HashSet<DiagnosticAnalyzer> { analyzer }; 166var completedAnalyzersForFile = filterScope.HasValue 218var completedAnalyzersForFile = GetCompletedAnalyzersForFile_NoLock(analysisScope.FilterFileOpt.Value, analysisScope.IsSyntacticSingleFileAnalysis);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (3)
86private readonly Dictionary<string, HashSet<string>> _assemblySimpleNameToOriginalPathListMap = new(SimpleNameComparer.Comparer); 183if (!_assemblySimpleNameToOriginalPathListMap.TryGetValue(simpleName, out var set)) 351if (!_assemblySimpleNameToOriginalPathListMap.TryGetValue(requestedName.Name, out var set))
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2865HashSet<SyntaxNode>? descendantDeclsToSkip = null;
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
919Action<TBlockStartAction, HashSet<TBlockAction>, ExecutionData, TArgs, CancellationToken> addActions, 921Action<HashSet<TBlockAction>, AnalyzerDiagnosticReporter, Func<Diagnostic, CancellationToken, bool>, ExecutionData, TArgs, CancellationToken> executeBlockActions,
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (9)
33private Dictionary<ISymbol, HashSet<ISymbol>?>? _lazyPendingMemberSymbolsMap; 167var dependentSymbols = getDependentSymbols(); 170_lazyPendingMemberSymbolsMap ??= new Dictionary<ISymbol, HashSet<ISymbol>?>(); 182HashSet<ISymbol>? getDependentSymbols() 184HashSet<ISymbol>? memberSet = null; 223private void VerifyNewEntryForPendingMemberSymbolsMap(ISymbol symbol, HashSet<ISymbol>? dependentSymbols) 227if (_lazyPendingMemberSymbolsMap.TryGetValue(symbol, out var existingDependentSymbols)) 411!_lazyPendingMemberSymbolsMap.TryGetValue(containingSymbol, out var pendingMemberSymbols)) 441if (_lazyPendingMemberSymbolsMap.TryGetValue(symbol, out var pendingMemberSymbols) &&
Emit\CommonPEModuleBuilder.cs (3)
659private HashSet<string> _namesOfTopLevelTypes; 723HashSet<string> names; 774static void AddTopLevelType(HashSet<string> names, Cci.INamespaceTypeDefinition type)
Emit\EditAndContinue\SymbolChanges.cs (2)
358var lazyReplacedSymbolsBuilder = (HashSet<ISymbolInternal>?)null;
Emit\NoPia\EmbeddedTypesManager.cs (3)
21public abstract ImmutableArray<Cci.INamespaceTypeDefinition> GetTypes(DiagnosticBag diagnostics, HashSet<string> namesOfTopLevelTypes); 90public override ImmutableArray<Cci.INamespaceTypeDefinition> GetTypes(DiagnosticBag diagnostics, HashSet<string> namesOfTopLevelTypes) 136private bool HasNameConflict(HashSet<string> namesOfTopLevelTypes, TEmbeddedType type, DiagnosticBag diagnostics)
InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
MetadataReader\MetadataDecoder.cs (2)
1984HashSet<TypeDefinitionHandle> visitedTypeDefTokens = new HashSet<TypeDefinitionHandle>(); 1985HashSet<TypeSymbol> visitedTypeSymbols = new HashSet<TypeSymbol>();
MetadataReader\PEModule.cs (1)
416HashSet<EntityHandle> nameTokens = new HashSet<EntityHandle>();
NativePdbWriter\PdbWriter.cs (2)
241private string TryEncodeImport(UsedNamespaceOrType import, HashSet<string> declaredExternAliasesOpt, bool isProjectLevel) 418private string GetAssemblyReferenceAlias(IAssemblyReference assembly, HashSet<string>? declaredExternAliases)
Operations\ControlFlowGraphBuilder.cs (1)
8073var set = new HashSet<IPropertySymbol>(SymbolEqualityComparer.IgnoreAll);
PEWriter\ReferenceIndexer.cs (1)
18private readonly HashSet<IImportScope> _alreadySeenScopes = new HashSet<IImportScope>();
PEWriter\ReferenceIndexerBase.cs (2)
18private readonly HashSet<IReferenceOrISignature> _alreadySeen = new(); 19private readonly HashSet<IReferenceOrISignature> _alreadyHasToken = new();
RuleSet\RuleSet.cs (1)
105private RuleSet GetEffectiveRuleSet(HashSet<string> includedRulesetPaths)
SourceGeneration\Nodes\GeneratorRunStateTable.cs (7)
27private readonly Dictionary<string, HashSet<IncrementalGeneratorRunStep>>? _namedSteps; 28private readonly Dictionary<string, HashSet<IncrementalGeneratorRunStep>>? _outputSteps; 34_namedSteps = new Dictionary<string, HashSet<IncrementalGeneratorRunStep>>(); 35_outputSteps = new Dictionary<string, HashSet<IncrementalGeneratorRunStep>>(); 57private static ImmutableDictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> StepCollectionToImmutable(Dictionary<string, HashSet<IncrementalGeneratorRunStep>>? builder) 93static void addToNamedStepCollection(Dictionary<string, HashSet<IncrementalGeneratorRunStep>> stepCollectionBuilder, IncrementalGeneratorRunStep step) 96if (!stepCollectionBuilder.TryGetValue(step.Name, out var stepsByName))
SourceGeneration\Nodes\InputNode.cs (1)
51var itemsSet = (_inputComparer == EqualityComparer<T>.Default) ? PooledHashSet<T>.GetInstance() : new HashSet<T>(_inputComparer);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
Symbols\Attributes\CommonAssemblyWellKnownAttributeData.cs (2)
432private HashSet<TNamedTypeSymbol> _forwardedTypes; 433public HashSet<TNamedTypeSymbol> ForwardedTypes
Syntax\SyntaxDiffer.cs (2)
25private readonly HashSet<GreenNode> _nodeSimilaritySet = new HashSet<GreenNode>(); 26private readonly HashSet<string> _tokenTextSimilaritySet = new HashSet<string>();
Text\CompositeText.cs (3)
363private static readonly ObjectPool<HashSet<SourceText>> s_uniqueSourcesPool 364= new ObjectPool<HashSet<SourceText>>(() => new HashSet<SourceText>(), 5); 371var uniqueSources = s_uniqueSourcesPool.Allocate();
Microsoft.CodeAnalysis.Analyzers (80)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (6)
155private readonly Dictionary<INamedTypeSymbol, HashSet<IInvocationOperation>> _codeActionCreateInvocations = []; 160private readonly Dictionary<INamedTypeSymbol, HashSet<IObjectCreationOperation>> _codeActionObjectCreations = []; 202private static void AddOperation<T>(INamedTypeSymbol namedType, T operation, Dictionary<INamedTypeSymbol, HashSet<T>> map) 207if (!map.TryGetValue(namedType, out HashSet<T> value)) 278&& _codeActionCreateInvocations.TryGetValue(fixer, out HashSet<IInvocationOperation> invocations)) 291&& _codeActionObjectCreations.TryGetValue(fixer, out HashSet<IObjectCreationOperation> objectCreations))
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
117var processedTypes = new HashSet<INamedTypeSymbol>();
MetaAnalyzers\RegisterActionAnalyzer.cs (2)
204private HashSet<IParameterSymbol>? _declaredStartAnalysisContextParams; 210private HashSet<IParameterSymbol>? _startAnalysisContextParamsToSkip;
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.AnalyzerUtilities (84)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
64protected override void AddTrackedEntities(CopyAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateDataFlowOperationVisitor.cs (1)
109protected sealed override void AddTrackedEntities(DictionaryAnalysisData<AnalysisEntity, TAbstractAnalysisValue> analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (1)
130protected override void AddTrackedEntities(PointsToAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (11)
59protected override void AddTrackedEntities(TaintedDataAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis) 482HashSet<SymbolAccess>? sourceOrigins = null; 570if (IsMethodArgumentASink(targetMethod, infosForType, taintedArgument, out HashSet<SinkKind>? sinkKinds)) 605if (this.IsPropertyASink(propertyReferenceOperation, out HashSet<SinkKind>? sinkKinds)) 683private static bool IsMethodArgumentASink(IMethodSymbol method, IEnumerable<SinkInfo> infosForType, IArgumentOperation taintedArgument, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 686Lazy<HashSet<SinkKind>> lazySinkKinds = new Lazy<HashSet<SinkKind>>(() => []); 723/// <param name="sinkKinds">If the property is a sink, <see cref="HashSet{SinkInfo}"/> containing the kinds of sinks; null otherwise.</param> 725private bool IsPropertyASink(IPropertyReferenceOperation propertyReferenceOperation, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 727Lazy<HashSet<SinkKind>> lazySinkKinds = new Lazy<HashSet<SinkKind>>(() => []);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.ValueContentDataFlowOperationVisitor.cs (1)
31protected override void AddTrackedEntities(ValueContentAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityBasedPredicateAnalysisData.cs (1)
167public void AddTrackedEntities(HashSet<AnalysisEntity> builder) => builder.UnionWith(CoreAnalysisData.Keys);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (3)
38protected void AddTrackedEntities(HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis = false) 40protected abstract void AddTrackedEntities(TAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis = false); 409private static IEnumerable<AnalysisEntity> GetChildAnalysisEntities(AnalysisEntity analysisEntity, HashSet<AnalysisEntity> allEntities)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (4)
49private readonly HashSet<IArgumentOperation> _pendingArgumentsToReset; 51private readonly HashSet<IOperation> _visitedFlowBranchConditions; 52private readonly HashSet<IFlowAnonymousFunctionOperation> _visitedLambdas; 53private readonly HashSet<IOperation>? _returnValueOperations;
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\LValueFlowCapturesProvider.cs (3)
33var rvalueFlowCaptureIds = new Dictionary<CaptureId, HashSet<IFlowCaptureReferenceOperation>>(); 44if (!rvalueFlowCaptureIds.TryGetValue(flowCaptureReference.Id, out var operations)) 60if (rvalueFlowCaptureIds.TryGetValue(captureId, out var operations))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Microsoft.CodeAnalysis.BannedApiAnalyzers (71)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.CodeStyle (72)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (4)
118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 136private readonly HashSet<IPropertySymbol> _propertiesWithShadowGetAccessorUsages = new(OriginalDefinitionSymbolEqualityComparer.Instance); 519using var _1 = s_originalDefinitionSymbolHashSetPool.GetPooledObject(out var symbolsReferencedInDocComments); 675HashSet<ISymbol> builder,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (11)
56private readonly ObjectPool<HashSet<string>> _fieldNamesPool = new(() => new(semanticFacts.SyntaxFacts.StringComparer)); 91SemanticModel semanticModel, IMethodSymbol accessor, HashSet<string> fieldNames, HashSet<IFieldSymbol> result, CancellationToken cancellationToken); 94HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken); 119var fieldNames = _fieldNamesPool.Allocate(); 221HashSet<string> fieldNames, 258HashSet<string> fieldNames, 275SemanticModel semanticModel, IMethodSymbol setMethod, HashSet<string> fieldNames, CancellationToken cancellationToken) 293HashSet<string> fieldNames, 329HashSet<string> fieldNames, 501HashSet<string> fieldNames,
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
141static bool ContainsLocalReference(HashSet<ILocalSymbol> declaredPatternSymbols, IOperation? target)
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (2)
58var whenTrueSymbols = semanticModel.GetAllDeclaredSymbols(whenTrue.Syntax, cancellationToken, n => !syntaxFacts.IsAnonymousOrLocalFunction(n)); 59var whenFalseSymbols = semanticModel.GetAllDeclaredSymbols(whenFalse.Syntax, cancellationToken, n => !syntaxFacts.IsAnonymousOrLocalFunction(n));
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Microsoft.CodeAnalysis.CodeStyle.Fixes (21)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
440var methodParameterNames = new HashSet<string>(comparer);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
174private static bool IsTypeLessAccessibleThanOtherType(ITypeSymbol? first, INamedTypeSymbol second, HashSet<ITypeSymbol> alreadyCheckingTypes)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
69HashSet<SyntaxNode> processedNodes,
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (5)
32protected abstract void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<TFieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators); 46var declarators = new HashSet<SyntaxNode>(); 47var fieldDeclarators = new HashSet<TFieldDeclarationSyntax>(); 95protected static void AdjustAndAddAppropriateDeclaratorsToRemove(SyntaxNode parentDeclaration, IEnumerable<SyntaxNode> childDeclarators, HashSet<SyntaxNode> declarators)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.Collections.Package (9)
Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
Microsoft.CodeAnalysis.CSharp (276)
Binder\Binder.CapturedParametersFinder.cs (2)
20private readonly HashSet<string> _namesToCheck; 23private CapturedParametersFinder(SynthesizedPrimaryConstructor primaryConstructor, HashSet<string> namesToCheck, ArrayBuilder<ParameterSymbol> captured)
Binder\Binder.ValueChecks.cs (2)
1960var previousVisited = _visited; 5788var previousVisited = _visited;
Binder\Binder_Attributes.cs (1)
459HashSet<string>? boundNamedArgumentsSet = null;
Binder\Binder_Expressions.cs (2)
1172private static void RemoveDuplicateInferredTupleNamesAndFreeIfEmptied(ref ArrayBuilder<string> inferredElementNames, HashSet<string> uniqueFieldNames) 6106private static void ReportDuplicateObjectMemberInitializers(BoundExpression boundMemberInitializer, HashSet<string> memberNameMap, BindingDiagnosticBag diagnostics)
Binder\Binder_Lookup.cs (5)
981var allMembers = new HashSet<Symbol>(comparer); 982var conflictingMembers = new HashSet<Symbol>(comparer); 1161var visited = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.ConsiderEverything); 1177static void addAllInterfaces(NamedTypeSymbol @interface, HashSet<NamedTypeSymbol> visited, ArrayBuilder<NamedTypeSymbol> result, ConsList<TypeSymbol> basesBeingResolved, ConsList<NamedTypeSymbol> cycleGuard) 1218HashSet<NamedTypeSymbol> seenInterfaces = null;
Binder\Binder_Operators.cs (2)
3640var existing = new HashSet<MethodSymbol>(PairedOperatorComparer.Instance); 3706var existing = new HashSet<MethodSymbol>(OverloadResolution.PairedExtensionOperatorSignatureComparer.Instance);
Binder\ConstantFieldsInProgress.cs (2)
21private readonly HashSet<SourceFieldSymbolWithSyntaxReference> _dependencies; 27HashSet<SourceFieldSymbolWithSyntaxReference> dependencies)
Binder\RefSafetyAnalysis.cs (1)
68private HashSet<BoundExpression>? _visited = new HashSet<BoundExpression>();
Binder\Semantics\BestTypeInferrer.cs (1)
69HashSet<TypeSymbol> candidateTypes = new HashSet<TypeSymbol>(comparer);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
1472var existing = new HashSet<MethodSymbol>(PairedExtensionOperatorSignatureComparer.Instance);
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (1)
121var existing = new HashSet<MethodSymbol>(PairedExtensionOperatorSignatureComparer.Instance);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (17)
146private readonly HashSet<TypeWithAnnotations>[] _exactBounds; 147private readonly HashSet<TypeWithAnnotations>[] _upperBounds; 148private readonly HashSet<TypeWithAnnotations>[] _lowerBounds; 348_exactBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 349_upperBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 350_lowerBounds = new HashSet<TypeWithAnnotations>[methodTypeParameters.Length]; 535private void AddBound(TypeWithAnnotations addedBound, HashSet<TypeWithAnnotations>[] collectedBounds, TypeWithAnnotations methodTypeParameterWithAnnotations) 2830var exact = _exactBounds[iParam]; 2831var lower = _lowerBounds[iParam]; 2832var upper = _upperBounds[iParam]; 2862HashSet<TypeWithAnnotations>? exact, 2863HashSet<TypeWithAnnotations>? lower, 2864HashSet<TypeWithAnnotations>? upper, 3001static bool containsFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 3006static bool containsNonFunctionTypes([NotNullWhen(true)] HashSet<TypeWithAnnotations>? types) 3372HashSet<TypeWithAnnotations> bounds, 3416HashSet<TypeWithAnnotations> bounds,
CodeGen\CodeGenerator.cs (2)
36private readonly HashSet<LocalSymbol> _stackLocals; 202internal static bool IsStackLocal(LocalSymbol local, HashSet<LocalSymbol> stackLocalsOpt)
CodeGen\CodeGenerator_HasHome.cs (2)
47HashSet<LocalSymbol> stackLocalsOpt) 176HashSet<LocalSymbol> stackLocalsOpt)
CodeGen\Optimizer.cs (1)
60out HashSet<LocalSymbol> stackLocals)
CommandLine\CSharpCompiler.cs (1)
99var uniqueFilePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Compilation\CSharpCompilation.cs (5)
137private HashSet<SyntaxTree>? _lazyCompilationUnitCompletedTrees; 2995var parseOptionsReported = new HashSet<ParseOptions>(); 4910var result = new HashSet<Symbol>(); 4922HashSet<Symbol> set) 4976ArrayBuilder<MergedNamespaceOrTypeDeclaration> spine, MergedTypeDeclaration current, HashSet<Symbol> set)
Compilation\CSharpSemanticModel.cs (1)
4215HashSet<Symbol> hiddenSymbols = new HashSet<Symbol>();
Compilation\SyntaxAndDeclarationManager.cs (3)
304public SyntaxAndDeclarationManager RemoveSyntaxTrees(HashSet<SyntaxTree> trees) 389HashSet<SyntaxTree> removeSet, 436HashSet<SyntaxTree> removeSet)
Compiler\DocumentationCommentCompiler.cs (6)
363HashSet<TypeParameterSymbol> documentedTypeParameters; 364HashSet<ParameterSymbol> documentedParameters; 532out HashSet<TypeParameterSymbol> documentedTypeParameters, 533out HashSet<ParameterSymbol> documentedParameters, 1164ref HashSet<ParameterSymbol> documentedParameters, 1165ref HashSet<TypeParameterSymbol> documentedTypeParameters,
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (6)
37private HashSet<ParameterSymbol> _documentedParameters; 38private HashSet<TypeParameterSymbol> _documentedTypeParameters; 46HashSet<ParameterSymbol> documentedParameters, 47HashSet<TypeParameterSymbol> documentedTypeParameters) 123ref HashSet<ParameterSymbol> documentedParameters, 124ref HashSet<TypeParameterSymbol> documentedTypeParameters)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (7)
37private HashSet<Location> _inProgressIncludeElementNodes; 38private HashSet<ParameterSymbol> _documentedParameters; 39private HashSet<TypeParameterSymbol> _documentedTypeParameters; 46HashSet<ParameterSymbol> documentedParameters, 47HashSet<TypeParameterSymbol> documentedTypeParameters, 70ref HashSet<ParameterSymbol> documentedParameters, 71ref HashSet<TypeParameterSymbol> documentedTypeParameters,
Declarations\DeclarationTable.cs (1)
216var set = new HashSet<string>();
Declarations\DeclarationTreeBuilder.cs (2)
1021Action<HashSet<string>, TData> addMemberNames, 1148Syntax.InternalSyntax.CSharpSyntaxNode member, HashSet<string> set)
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
970HashSet<NamedTypeSymbol> seen = null; 981private static void InterfacesVisit(NamedTypeSymbol namedType, ArrayBuilder<NamedTypeSymbol> builder, ref HashSet<NamedTypeSymbol> seen)
Emitter\Model\PEModuleBuilder.cs (3)
655internal static HashSet<NamedTypeSymbol> GetForwardedTypes(SourceAssemblySymbol sourceAssembly, ArrayBuilder<Cci.ExportedType>? builder) 657var seenTopLevelForwardedTypes = new HashSet<NamedTypeSymbol>(); 737HashSet<NamedTypeSymbol> seenTopLevelTypes,
Errors\DiagnosticBagExtensions.cs (2)
65HashSet<DiagnosticInfo> useSiteDiagnostics) 76HashSet<DiagnosticInfo> useSiteDiagnostics)
FlowAnalysis\AbstractRegionDataFlowPass.cs (2)
22HashSet<Symbol> initiallyAssignedVariables = null, 23HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes = null,
FlowAnalysis\AlwaysAssignedWalker.cs (1)
26private readonly HashSet<LabelSymbol> _labelsInside = new HashSet<LabelSymbol>();
FlowAnalysis\CSharpDataFlowAnalysis.cs (6)
29private HashSet<Symbol> _unassignedVariables; 44private HashSet<PrefixUnaryExpressionSyntax> _unassignedVariableAddressOfSyntaxes; 76private HashSet<Symbol> UnassignedVariables 82var result = Succeeded 357private HashSet<PrefixUnaryExpressionSyntax> UnassignedVariableAddressOfSyntaxes 363var result = Succeeded
FlowAnalysis\DataFlowsInWalker.cs (8)
25private readonly HashSet<Symbol> _dataFlowsIn = new HashSet<Symbol>(); 28HashSet<Symbol> unassignedVariables, HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes) 33internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, 34HashSet<Symbol> unassignedVariables, HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes, out bool? succeeded) 40var result = walker.Analyze(ref badRegion); 50private HashSet<Symbol> Analyze(ref bool badRegion)
FlowAnalysis\DataFlowsOutWalker.cs (7)
27private DataFlowsOutWalker(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 33internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<Symbol> unassignedVariables, ImmutableArray<ISymbol> dataFlowsIn) 39var result = walker.Analyze(ref badRegion); 54private readonly HashSet<Symbol> _dataFlowsOut = new HashSet<Symbol>(); 58private readonly HashSet<Symbol> _assignedInside = new HashSet<Symbol>(); 61private HashSet<Symbol> Analyze(ref bool badRegion)
FlowAnalysis\DefiniteAssignment.cs (7)
60private readonly HashSet<Symbol>? initiallyAssignedVariables; 132private readonly HashSet<PrefixUnaryExpressionSyntax>? _unassignedVariableAddressOfSyntaxes; 173HashSet<PrefixUnaryExpressionSyntax>? unassignedVariableAddressOfSyntaxes = null, 198HashSet<Symbol>? initiallyAssignedVariables = null) 220HashSet<Symbol> initiallyAssignedVariables, 221HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes, 593HashSet<Diagnostic> compatDiagnosticSet = new HashSet<Diagnostic>(compatDiagnostics.AsEnumerable(), SameDiagnosticComparer.Instance);
FlowAnalysis\DefinitelyAssignedWalker.cs (6)
23private readonly HashSet<Symbol> _definitelyAssignedOnEntry = new HashSet<Symbol>(); 24private readonly HashSet<Symbol> _definitelyAssignedOnExit = new HashSet<Symbol>(); 36internal static (HashSet<Symbol> entry, HashSet<Symbol> exit) Analyze( 66private void ProcessRegion(HashSet<Symbol> definitelyAssigned) 86private void ProcessState(HashSet<Symbol> definitelyAssigned, LocalState state1, LocalState state2opt)
FlowAnalysis\EntryPointsWalker.cs (2)
31var result = walker._entryPoints; 41private readonly HashSet<LabeledStatementSyntax> _entryPoints = new HashSet<LabeledStatementSyntax>();
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
23private readonly HashSet<BoundExpression> _visitedExpressions = new HashSet<BoundExpression>();
FlowAnalysis\ReadWriteWalker.cs (8)
22CSharpCompilation compilation, Symbol member, BoundNode node, BoundNode firstInRegion, BoundNode lastInRegion, HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes, 65private readonly HashSet<Symbol> _readInside = new HashSet<Symbol>(); 66private readonly HashSet<Symbol> _writtenInside = new HashSet<Symbol>(); 67private readonly HashSet<Symbol> _readOutside = new HashSet<Symbol>(); 68private readonly HashSet<Symbol> _writtenOutside = new HashSet<Symbol>(); 71HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes) 175private void NoteReceiverReadOrWritten(BoundFieldAccess expr, HashSet<Symbol> readOrWritten) 183private void NoteExpressionReadOrWritten(BoundExpression receiver, HashSet<Symbol> readOrWritten)
FlowAnalysis\UnassignedAddressTakenVariablesWalker.cs (4)
23internal static HashSet<PrefixUnaryExpressionSyntax> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node) 29var result = walker.Analyze(ref badRegion); 39private readonly HashSet<PrefixUnaryExpressionSyntax> _result = new HashSet<PrefixUnaryExpressionSyntax>(); 41private HashSet<PrefixUnaryExpressionSyntax> Analyze(ref bool badRegion)
FlowAnalysis\UnassignedVariablesWalker.cs (4)
26internal static HashSet<Symbol> Analyze(CSharpCompilation compilation, Symbol member, BoundNode node, 39var result = walker.Analyze(ref badRegion); 48private readonly HashSet<Symbol> _result = new HashSet<Symbol>(); 50private HashSet<Symbol> Analyze(ref bool badRegion)
FlowAnalysis\VariablesDeclaredWalker.cs (1)
38private HashSet<Symbol> _variablesDeclared = new HashSet<Symbol>();
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (10)
759private Dictionary<BoundTryStatement, HashSet<LabelSymbol>> _labelsInInterestingTry; 761private HashSet<BoundCatchBlock> _awaitContainingCatches; 800internal HashSet<LabelSymbol> Labels(BoundTryStatement statement) 807var origLabels = this.currentLabels; 822_labelsInInterestingTry = labelsInInterestingTry = new Dictionary<BoundTryStatement, HashSet<LabelSymbol>>(); 856var awaitContainingCatches = _awaitContainingCatches; 877var origLabels = this.currentLabels; 893var origLabels = this.currentLabels; 915public readonly HashSet<LabelSymbol> LabelsOpt; 937public AwaitFinallyFrame(AwaitFinallyFrame parent, HashSet<LabelSymbol> labelsOpt, SyntaxNode syntax)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (5)
272/// <see cref="Build(BoundNode, MethodSymbol, HashSet{MethodSymbol}, DiagnosticBag)"/> 321private readonly HashSet<Symbol> _freeVariables = new HashSet<Symbol>(); 331private readonly HashSet<MethodSymbol> _methodsConvertedToDelegates; 352HashSet<MethodSymbol> methodsConvertedToDelegates, 370HashSet<MethodSymbol> methodsConvertedToDelegates,
Lowering\ClosureConversion\ClosureConversion.cs (3)
97private readonly HashSet<LocalSymbol> _assignLocals; 173HashSet<LocalSymbol> assignLocals) 244HashSet<LocalSymbol> assignLocals)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.IteratorFinallyFrame.cs (2)
34public readonly HashSet<LabelSymbol> labels; 47HashSet<LabelSymbol> labels)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.YieldsInTryAnalysis.cs (6)
23private Dictionary<BoundTryStatement, HashSet<LabelSymbol>> _labelsInYieldingTrys; 54internal HashSet<LabelSymbol> Labels(BoundTryStatement statement) 62var origLabels = this.currentLabels; 77_labelsInYieldingTrys = yieldingTryLabels = new Dictionary<BoundTryStatement, HashSet<LabelSymbol>>(); 122protected HashSet<LabelSymbol> currentLabels; 134var currentLabels = this.currentLabels;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (4)
207static bool usedTypeParametersContains(HashSet<TypeParameterSymbol> used, ImmutableArray<TypeParameterSymbol> typeParameters) 221private static void FindTypeParameters(TypeSymbol type, HashSet<TypeParameterSymbol> result) 224private static void FindTypeParameters(MethodSymbol method, HashSet<TypeParameterSymbol> result) 234private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_typeParameterSymbolCollector = (typeSymbol, result, _) =>
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (4)
440HashSet<BoundDecisionDagNode> loweredNodes, 498private bool GenerateSwitchDispatch(BoundDecisionDagNode node, HashSet<BoundDecisionDagNode> loweredNodes) 551HashSet<BoundDecisionDagNode> loweredNodes, 560HashSet<BoundDecisionDagNode> loweredNodes,
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (3)
167private Dictionary<BoundNode, HashSet<LabelSymbol>>? _lazyUnmatchedLabelCache; 179_lazyUnmatchedLabelCache = new Dictionary<BoundNode, HashSet<LabelSymbol>>(); 182HashSet<LabelSymbol> unmatched = UnmatchedGotoFinder.Find(node, _lazyUnmatchedLabelCache, RecursionDepth);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (3)
42private IteratorAndAsyncCaptureWalker(CSharpCompilation compilation, MethodSymbol method, BoundNode node, HashSet<Symbol> initiallyAssignedVariables) 55var initiallyAssignedVariables = UnassignedVariablesWalker.Analyze(compilation, method, node, convertInsufficientExecutionStackExceptionToCancelledByStackGuardException: true); 350private readonly HashSet<Symbol> _localsInScope;
Lowering\SyntheticBoundNodeFactory.cs (1)
1122var labels = new HashSet<int>();
Lowering\UnmatchedGotoFinder.cs (9)
22private readonly Dictionary<BoundNode, HashSet<LabelSymbol>> _unmatchedLabelsCache; // NB: never modified. 24private HashSet<LabelSymbol> _gotos; 25private HashSet<LabelSymbol> _targets; 27private UnmatchedGotoFinder(Dictionary<BoundNode, HashSet<LabelSymbol>> unmatchedLabelsCache, int recursionDepth) 34public static HashSet<LabelSymbol> Find(BoundNode node, Dictionary<BoundNode, HashSet<LabelSymbol>> unmatchedLabelsCache, int recursionDepth) 38HashSet<LabelSymbol> gotos = finder._gotos; 39HashSet<LabelSymbol> targets = finder._targets; 49HashSet<LabelSymbol> unmatched;
Parser\DocumentationCommentParser.cs (1)
321private readonly HashSet<string> _attributesSeen = new HashSet<string>();
Symbols\AbstractTypeMap.cs (1)
345HashSet<TypeParameterSymbol> ignoreTypesDependentOnTypeParametersOpt)
Symbols\ArrayTypeSymbol.cs (1)
466internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\BaseTypeAnalysis.cs (6)
33private static void TypeDependsClosure(NamedTypeSymbol type, CSharpCompilation currentCompilation, HashSet<Symbol> partialClosure) 80private static void StructDependsClosure(NamedTypeSymbol type, HashSet<NamedTypeSymbol> partialClosure, HashSet<NamedTypeSymbol> typesWithCycle, ConsList<NamedTypeSymbol> on) 112static void visitFields(NamedTypeSymbol type, HashSet<NamedTypeSymbol> partialClosure, HashSet<NamedTypeSymbol> typesWithCycle, ConsList<NamedTypeSymbol> on) 173static (bool definitelyManaged, bool hasGenerics) dependsOnDefinitelyManagedType(NamedTypeSymbol type, HashSet<Symbol> partialClosure, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Symbols\Compilation_UsedAssemblies.cs (1)
31var setOfReferences = new HashSet<MetadataReference>(ReferenceEqualityComparer.Instance);
Symbols\ConstantValueUtils.cs (1)
32HashSet<SourceFieldSymbolWithSyntaxReference> dependencies,
Symbols\ConstraintsHelper.cs (2)
907HashSet<TypeParameterSymbol> ignoreTypeConstraintsDependentOnTypeParametersOpt = null) 1064HashSet<TypeParameterSymbol> ignoreTypeConstraintsDependentOnTypeParametersOpt)
Symbols\ConstructedNamedTypeSymbol.cs (2)
30internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 113internal sealed override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\DynamicTypeSymbol.cs (1)
186internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\EventSymbol.cs (1)
300HashSet<TypeSymbol>? unificationCheckedTypes = null;
Symbols\FieldSymbol.cs (1)
366HashSet<TypeSymbol> unificationCheckedTypes = null;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
800internal bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo? result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
157internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo? result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\FunctionTypeSymbol.cs (1)
158internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) => throw ExceptionUtilities.Unreachable();
Symbols\MemberSignatureComparer.cs (5)
691var substitutedTypes1 = new HashSet<TypeSymbol>(comparer); 692var substitutedTypes2 = new HashSet<TypeSymbol>(comparer); 721private static bool AreConstraintTypesSubset(HashSet<TypeSymbol> constraintTypes1, HashSet<TypeSymbol> constraintTypes2, TypeParameterSymbol typeParameter2) 751private static void SubstituteConstraintTypes(ImmutableArray<TypeWithAnnotations> types, TypeMap? typeMap, HashSet<TypeSymbol> result)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
973var names = new HashSet<string>(); 1047private static ICollection<string> CreateReadOnlyMemberNames(HashSet<string> names)
Symbols\MethodSymbol.cs (1)
974HashSet<TypeSymbol> unificationCheckedTypes = null;
Symbols\NamedTypeSymbol.cs (2)
1429HashSet<TypeSymbol> unificationCheckedTypes = null; 1456internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\PointerTypeSymbol.cs (1)
297internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\PropertyOrEventSymbolExtensions.cs (1)
46var symbolsForExplicitlyImplementedAccessors = new HashSet<T>();
Symbols\PropertySymbol.cs (1)
415HashSet<TypeSymbol> unificationCheckedTypes = null;
Symbols\Source\ConstantEvaluationHelpers.cs (1)
75var map = new HashSet<SourceFieldSymbolWithSyntaxReference>(order.Select(o => o.Field).Distinct());
Symbols\Source\GlobalExpressionVariable.cs (1)
65HashSet<SourceFieldSymbolWithSyntaxReference> dependencies,
Symbols\Source\LambdaSymbol.cs (1)
29private readonly HashSet<AssemblySymbol> _declarationDependencies;
Symbols\Source\LocalFunctionSymbol.cs (1)
36private readonly HashSet<AssemblySymbol> _declarationDependencies;
Symbols\Source\SourceAssemblySymbol.cs (13)
993var knownModuleNames = new HashSet<String>(StringComparer.OrdinalIgnoreCase); 1189private HashSet<CSharpAttributeData> GetUniqueSourceAssemblyAttributes() 1193HashSet<CSharpAttributeData> uniqueAttributes = null; 1210private static bool AddUniqueAssemblyAttribute(CSharpAttributeData attribute, ref HashSet<CSharpAttributeData> uniqueAttributes) 1222private bool ValidateAttributeUsageForNetModuleAttribute(CSharpAttributeData attribute, string netModuleName, BindingDiagnosticBag diagnostics, ref HashSet<CSharpAttributeData> uniqueAttributes) 1326HashSet<CSharpAttributeData> uniqueAttributes = GetUniqueSourceAssemblyAttributes(); 1385var unused = GetUniqueSourceAssemblyAttributes(); 1389HashSet<NamedTypeSymbol> forwardedTypes = null; 1493HashSet<CSharpAttributeData> uniqueAttributes = null; 1709internal HashSet<NamedTypeSymbol> GetForwardedTypes() 2253HashSet<NamedTypeSymbol> forwardedTypes = assemblyData.ForwardedTypes; 2688HashSet<FieldSymbol> handledUnreadFields = null; 2830HashSet<NamedTypeSymbol> forwardedTypes = GetForwardedTypes();
Symbols\Source\SourceEnumConstantSymbol.cs (3)
155protected override ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics) 173protected override ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics) 202protected override ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceFieldSymbol.cs (1)
381protected abstract ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics);
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1979var conversionsAsConversions = new HashSet<MethodSymbol>(ConversionSignatureComparer.Comparer);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
634protected sealed override ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics)
Symbols\SubstitutedNamedTypeSymbol.cs (2)
189internal abstract override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes); 276var replacedFields = new HashSet<Symbol>(ReferenceEqualityComparer.Instance);
Symbols\Symbol.cs (5)
1341internal static bool GetUnificationUseSiteDiagnosticRecursive<T>(ref DiagnosticInfo result, ImmutableArray<T> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) where T : TypeSymbol 1354internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1367internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<CustomModifier> modifiers, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1380internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<ParameterSymbol> parameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1394internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeParameterSymbol> typeParameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\Symbol_Attributes.cs (3)
486var toRemove = new HashSet<Diagnostic>(ReferenceEqualityComparer.Instance); 851HashSet<NamedTypeSymbol> uniqueAttributeTypes = new HashSet<NamedTypeSymbol>(); 892HashSet<NamedTypeSymbol> uniqueAttributeTypes)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
200var notAnnotatedDiagnosticsSet = new HashSet<Diagnostic>(notAnnotatedDiagnostics.AsEnumerable(), SameDiagnosticComparer.Instance);
Symbols\Tuples\TupleTypeSymbol.cs (1)
569protected ArrayBuilder<Symbol> MakeSynthesizedTupleMembers(ImmutableArray<Symbol> currentMembers, HashSet<Symbol>? replacedFields = null)
Symbols\TypeParameterSymbol.cs (1)
648internal sealed override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\TypeParameterSymbolExtensions.cs (1)
17HashSet<TypeParameterSymbol>? visited = null;
Symbols\TypeSymbol.cs (3)
340var visited = new HashSet<NamedTypeSymbol>(SymbolEqualityComparer.ConsiderEverything); 354static void addAllInterfaces(NamedTypeSymbol @interface, HashSet<NamedTypeSymbol> visited, ArrayBuilder<NamedTypeSymbol> result) 531internal abstract bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes);
Symbols\TypeSymbolExtensions.cs (3)
1219public static bool ContainsTypeParameters(this TypeSymbol type, HashSet<TypeParameterSymbol> parameters) 1225private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_containsTypeParametersPredicate = 1541public static bool MarkCheckedIfNecessary(this TypeSymbol type, ref HashSet<TypeSymbol> checkedTypes)
Symbols\TypeWithAnnotations.cs (1)
424public bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Syntax\SyntaxNodeRemover.cs (2)
50private readonly HashSet<SyntaxNode> _nodesToRemove; 54private HashSet<SyntaxNode>? _directivesToKeep;
Syntax\SyntaxReplacer.cs (7)
70private readonly HashSet<SyntaxNode> _nodeSet; 71private readonly HashSet<SyntaxToken> _tokenSet; 72private readonly HashSet<SyntaxTrivia> _triviaSet; 73private readonly HashSet<TextSpan> _spanSet; 100private static readonly HashSet<SyntaxNode> s_noNodes = new HashSet<SyntaxNode>(); 101private static readonly HashSet<SyntaxToken> s_noTokens = new HashSet<SyntaxToken>(); 102private static readonly HashSet<SyntaxTrivia> s_noTrivia = new HashSet<SyntaxTrivia>();
Utilities\FirstAmongEqualsSet.cs (1)
41private readonly HashSet<T> _hashSet;
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
48HashSet<string> fieldNames, 241HashSet<string> fieldNames, 242HashSet<IFieldSymbol> result,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
47nameof(HashSet<>),
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
205var existingSymbols = GetExistingSymbols(semanticModel, container, cancellationToken); 287private static HashSet<ISymbol> GetExistingSymbols(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
164var result = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
30var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
53var declarationsToRemove = new HashSet<StatementSyntax>(); 100HashSet<StatementSyntax> declarationsToRemove,
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
110var visitedFieldDeclarations = new HashSet<FieldDeclarationSyntax>();
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs (2)
26protected override void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<FieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
58var accessorLists = new HashSet<AccessorListSyntax>(); 76HashSet<AccessorListSyntax> accessorLists,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
63var nodesToTrack = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
45HashSet<INamespaceSymbol> conflicts, 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
45var unnecessaryImports = await GetCommonUnnecessaryImportsOfAllContextAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
52var symbolsInBlock = semanticModel.GetAllDeclaredSymbols(container, cancellationToken,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
75var actualFolderPaths = new HashSet<string>();
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (1)
1485var hashset = new HashSet<string>(expectedTypesInRelativeOrder);
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
39var symbolKindsWithNoCodeBlocks = new HashSet<SymbolKind> 45var missingSyntaxNodes = new HashSet<SyntaxKind>
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (1)
535private readonly HashSet<string> _logs = [];
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
CodeGen\CodeGenDeconstructTests.cs (3)
6035var set = new HashSet<ISymbol>(); 6088var set = new HashSet<ISymbol>(); 6136var set = new HashSet<ISymbol>();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (22)
Attributes\AttributeTests_Assembly.cs (1)
1040var uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance);
Diagnostics\CompilationEventTests.cs (1)
20var expected = new HashSet<string>();
Diagnostics\DiagnosticAnalyzerTests.AllInOne.cs (2)
28var symbolKindsWithNoCodeBlocks = new HashSet<SymbolKind>(); 32var missingSyntaxKinds = new HashSet<SyntaxKind>();
Diagnostics\DiagnosticAnalyzerTests.cs (1)
353var diagIds = new HashSet<string>(diags.Select(d => d.Id));
Diagnostics\GetDiagnosticsTests.cs (17)
177HashSet<string> declaredSymbolNames, completedCompilationUnits; 226HashSet<string> declaredSymbolNames, completedCompilationUnits; 278HashSet<string> declaredSymbolNames, completedCompilationUnits; 345HashSet<string> declaredSymbolNames, completedCompilationUnits; 411HashSet<string> declaredSymbols, completedCompilationUnits; 451private static bool DequeueCompilationEvents(AsyncQueue<CompilationEvent> eventQueue, out bool compilationStartedFired, out HashSet<string> declaredSymbolNames, out HashSet<string> declaredSymbols, out HashSet<string> completedCompilationUnits) 1124var uniqueCallbacks = new HashSet<SyntaxNode>(); 1685var expectedSymbolCallbacks = new HashSet<string>() { "C", "M1" }; 1686var expectedSyntaxNodeCallbacks = new HashSet<string>() { "int x11 = 0;" }; 1687var expectedSyntaxNodeInsideBlockCallbacks = new HashSet<string>(); 1688var expectedOperationCallbacks = new HashSet<string>() { "int x11 = 0" }; 1689var expectedOperationInsideBlockCallbacks = new HashSet<string>(); 1690var expectedBlockSymbolCallbacks = new HashSet<string>(); 1691var expectedSymbolStartSymbolCallbacks = new HashSet<string>(); 1692var expectedSemanticModelTreeCallbacks = new HashSet<SyntaxTree>();
Microsoft.CodeAnalysis.CSharp.Features (38)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
101private (ITypeSymbol, bool plural) UnwrapType(ITypeSymbol type, Compilation compilation, bool wasPlural, HashSet<ITypeSymbol> seenTypes)
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (2)
74var completionItems = new HashSet<CompletionItem>(CompletionItemComparer.Instance); 92private static void AddTypes(HashSet<CompletionItem> completionItems, int contextPosition, SemanticModel semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
169protected override HashSet<string> GetInitializedMembers(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
76var alreadyTestedMembers = new HashSet<string>(propertyPatternClause.Subpatterns.Select(
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
35private static readonly HashSet<string> s_snippetsWithReplacements =
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
28var variableNamesReadInside = new HashSet<string>(ForEachInfo.Statements
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
955public HashSet<string> IdentifierNames { get; private set; }
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
55protected override bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (2)
25private readonly HashSet<SyntaxAnnotation> _variableToRemoveMap; 32HashSet<SyntaxAnnotation> variableToRemoveMap,
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (3)
117var variableMapToRemove = CreateVariableDeclarationToRemoveMap( 589var variableToRemoveMap = CreateVariableDeclarationToRemoveMap( 695HashSet<SyntaxAnnotation> variablesToRemove)
ExtractMethod\Extensions.cs (1)
233public static bool HasSyntaxAnnotation(this HashSet<SyntaxAnnotation> set, SyntaxNode node)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
385var innermostStatements = new HashSet<StatementSyntax>(matches.Select(expr => GetApplicableStatementAncestors(expr).First()));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (2)
40var innermostClauses = new HashSet<SyntaxNode>( 57var allAffectedClauses = new HashSet<SyntaxNode>(matches.SelectMany(expr => expr.GetAncestorsOrThis<SyntaxNode>().Where(IsAnyQueryClause)));
NavigationBar\CSharpNavigationBarItemService.cs (2)
63Solution solution, SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken) 136SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
48HashSet<string> fieldNames, 241HashSet<string> fieldNames, 242HashSet<IFieldSymbol> result,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
47nameof(HashSet<>),
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
205var existingSymbols = GetExistingSymbols(semanticModel, container, cancellationToken); 287private static HashSet<ISymbol> GetExistingSymbols(
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
53var declarationsToRemove = new HashSet<StatementSyntax>(); 100HashSet<StatementSyntax> declarationsToRemove,
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
110var visitedFieldDeclarations = new HashSet<FieldDeclarationSyntax>();
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs (2)
26protected override void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<FieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (2)
58var accessorLists = new HashSet<AccessorListSyntax>(); 76HashSet<AccessorListSyntax> accessorLists,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
63var nodesToTrack = new HashSet<SyntaxNode>();
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (3)
112HashSet<CastExpressionSyntax> matches, 151var tempMatches = new HashSet<CastExpressionSyntax>(); 212string localName, HashSet<CastExpressionSyntax> matches,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
64var usedLocals = new HashSet<ILocalSymbol>();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
664var obj = new HashSet<int>();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\DynamicTests.cs (1)
69HashSet<DiagnosticInfo> useSiteDiagnostics = null;
Semantics\LookupTests.cs (2)
439HashSet<DiagnosticInfo> useSiteDiagnostics = null; 586HashSet<DiagnosticInfo> useSiteDiagnostics = null;
Semantics\NullableConversionTests.cs (1)
810HashSet<DiagnosticInfo> unused = null;
Semantics\NullableReferenceTypesTests.cs (1)
157954var reportedDiagnostics = new HashSet<Diagnostic>();
Semantics\OperatorTests.cs (1)
8084HashSet<DiagnosticInfo> useSiteDiagnostics = null;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (18)
Compilation\CompilationAPITests.cs (2)
517var hs = new HashSet<MetadataReference> { ref1, ref2, ref3 }; 844var hs = new HashSet<SyntaxTree> { t4, t5, t6 };
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
2175HashSet<DiagnosticInfo> useSiteDiagnostics = null;
DocumentationComments\CrefTests.cs (1)
5519HashSet<DiagnosticInfo> useSiteDiagnostics = null;
Symbols\ConversionTests.cs (2)
176HashSet<DiagnosticInfo> useSiteDiagnostics = null; 317HashSet<DiagnosticInfo> useSiteDiagnostics = null;
Symbols\CorLibrary\CorTypes.cs (1)
58var knownMissingTypes = new HashSet<int>()
Symbols\Metadata\MetadataMemberTests.cs (4)
622var memberNames1 = new HashSet<string>(test1.MemberNames); 632var memberNames2 = new HashSet<string>(test2.MemberNames); 663var memberNames1 = new HashSet<string>(test1.MemberNames); 674var memberNames2 = new HashSet<string>(test2.MemberNames);
Symbols\Metadata\PE\BaseTypeResolution.cs (1)
222var bases = new HashSet<NamedTypeSymbol>();
Symbols\Metadata\PE\TypeForwarders.cs (2)
1478var topLevelTypes = new HashSet<string>(); 1747var topLevelTypes = new HashSet<string>();
Symbols\RequiredMembersTests.cs (1)
35var requiredTypes = new HashSet<NamedTypeSymbol>();
Symbols\Source\IndexedTypeParameterTests.cs (1)
36var set = new HashSet<TypeParameterSymbol>(fifty);
Symbols\TypeTests.cs (2)
2454var uniqueMethods = new HashSet<MethodSymbol>(); 2620var uniqueTypes = new HashSet<TypeSymbol>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Diagnostics\DiagnosticTest.cs (1)
57var set = new HashSet<ErrorCode>();
IncrementalParsing\SyntaxDifferences.cs (3)
25var hashSet = new HashSet<GreenNode>(); 33private static void GetRebuiltNodes(SyntaxNodeOrToken newNode, HashSet<GreenNode> hashSet, ArrayBuilder<SyntaxNodeOrToken> nodes) 48private static void GatherNodes(SyntaxNodeOrToken node, HashSet<GreenNode> hashSet)
Syntax\SyntaxTests.cs (2)
310var returnedKindsInts = ((IEnumerable<SyntaxKind>)method.Invoke(null, null)).Select(static k => (int)k).ToHashSet(); 331var returnedKindsInts = SyntaxFacts.GetPreprocessorKeywordKinds().Select(static k => (int)k).ToHashSet();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (6)
Extensions.cs (5)
887public static Conversion ClassifyConversionFromType(this ConversionsBase conversions, TypeSymbol source, TypeSymbol destination, ref HashSet<DiagnosticInfo> useSiteDiagnostics, bool forCast = false) 895private static void AddDiagnosticInfos(ref HashSet<DiagnosticInfo> useSiteDiagnostics, CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 901useSiteDiagnostics = (HashSet<DiagnosticInfo>)useSiteInfo.Diagnostics; 910public static Conversion ClassifyConversionFromExpression(this Conversions conversions, BoundExpression sourceExpression, TypeSymbol destination, ref HashSet<DiagnosticInfo> useSiteDiagnostics, bool forCast = false) 927ref HashSet<DiagnosticInfo> useSiteDiagnostics)
TestAttributesVisitor.cs (1)
17protected readonly HashSet<Symbol> _reported;
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
Rename\CSharpRenameRewriterLanguageService.cs (2)
68private readonly HashSet<SyntaxToken> _annotatedIdentifierTokens = []; 69private readonly HashSet<InvocationExpressionSyntax> _invocationExpressionsNeedingConflictChecks = [];
Simplification\CSharpSimplificationService.cs (1)
185protected override void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken)
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (1)
34private readonly HashSet<SyntaxNode> _processedParentNodes = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
164var result = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
30var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
45HashSet<INamespaceSymbol> conflicts, 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
45var unnecessaryImports = await GetCommonUnnecessaryImportsOfAllContextAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
52var symbolsInBlock = semanticModel.GetAllDeclaredSymbols(container, cancellationToken,
Microsoft.CodeAnalysis.EditorFeatures (16)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
42private readonly HashSet<ITextView> _subscribedViews = [];
Editor\TextBufferAssociatedViewService.cs (6)
29private static readonly HashSet<ITextView> s_registeredViews = []; 33private static readonly ConditionalWeakTable<ITextBuffer, HashSet<ITextView>> s_map = new(); 51if (!s_map.TryGetValue(buffer, out var set)) 73if (s_map.TryGetValue(buffer, out var set)) 98if (!s_map.TryGetValue(textBuffer, out var set)) 150if (s_map.TryGetValue(buffer, out var set))
EditorConfigSettings\Extensions\EnumerableExtensions.cs (1)
14var seenKeys = new HashSet<TKey>();
InlineRename\InlineRenameSession.cs (1)
204var openBuffers = new HashSet<ITextBuffer>();
Shared\Tagging\Utilities\TagSpanIntervalTree.cs (4)
107public void AddAllSpans(ITextSnapshot textSnapshot, HashSet<TagSpan<TTag>> tagSpans) 113/// <inheritdoc cref="AddAllSpans(ITextSnapshot, HashSet{TagSpan{TTag}})"/> 121/// <inheritdoc cref="AddAllSpans(ITextSnapshot, HashSet{TagSpan{TTag}})"/> 134ArrayBuilder<SnapshotSpan> snapshotSpansToRemove, HashSet<TagSpan<TTag>> tagSpans)
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (2)
51private readonly ObjectPool<HashSet<TagSpan<TTag>>> _tagSpanSetPool; 150_tagSpanSetPool = new ObjectPool<HashSet<TagSpan<TTag>>>(() => new HashSet<TagSpan<TTag>>(this), trimOnFree: false);
Workspaces\AbstractTextBufferVisibilityTracker.cs (1)
136public readonly HashSet<ITextView> TextViews = [];
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Classification\AbstractClassifierTests.cs (1)
287var classificationsSpans = new HashSet<TextSpan>();
Rename\RenamerTests.cs (1)
50var remainingErrors = new HashSet<string>(expectedErrors ?? []);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
CodeFixes\CodeFixServiceTests.cs (3)
115var uniqueTitles = new HashSet<string>(); 648var fixTitles = fixes.SelectMany(fixCollection => fixCollection.Fixes).Select(f => f.Action.Title).ToHashSet(); 1173var variableDeclarations = new HashSet<SyntaxNode>();
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (1)
29var uniqueDiagnosticIds = new HashSet<string>();
Extensions\SetExtensionTests.cs (1)
18var set = new HashSet<string>() { "a", "b", "c" };
Utilities\BloomFilterTests.cs (7)
48var strings = new HashSet<string>(GenerateStrings(2000).Skip(500).Take(1000), comparer); 168var longs = CreateLongs([.. GenerateStrings(2000).Skip(500).Take(1000).Select(s => s.GetHashCode())]); 169var testLongs = CreateLongs([.. GenerateStrings(100000).Select(s => s.GetHashCode())]); 209var allHashSets = new List<HashSet<string>> 242var strings = allHashSets[i]; 275private static HashSet<long> CreateLongs(List<int> ints) 277var result = new HashSet<long>();
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
19private readonly HashSet<ITypeParameterSymbol> _acceptableTypeParameters;
Microsoft.CodeAnalysis.Extensions.Package (12)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Microsoft.CodeAnalysis.Features (145)
AddImport\AbstractAddImportFeatureService.cs (5)
224var viableUnreferencedProjects = GetViableUnreferencedProjects(project); 272var seenReferences = new HashSet<PortableExecutableReference>(comparer: this); 322Project project, HashSet<PortableExecutableReference> seenReferences) 454private static HashSet<Project> GetViableUnreferencedProjects(Project project) 457var viableProjects = new HashSet<Project>(solution.Projects.Where(p => p.SupportsCompilation));
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
62var uniqueIdentities = new HashSet<AssemblyIdentity>();
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
79var result = new HashSet<PackageWithAssemblyResult>();
AddPackage\AbstractAddSpecificPackageCodeFixProvider.cs (1)
37var assemblyNames = new HashSet<string> { assemblyName };
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (1)
69HashSet<string>? globalAliases,
CodeFixes\FixAllOccurrences\AbstractFixAllCodeFixCodeAction.cs (3)
19private static readonly HashSet<string> s_predefinedCodeFixProviderNames = GetPredefinedCodeFixProviderNames(); 43private static HashSet<string> GetPredefinedCodeFixProviderNames() 45var names = new HashSet<string>();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
220var uniqueIds = new HashSet<string>();
CodeFixesAndRefactorings\CodeActionRequestPriorityProvider.cs (2)
116private HashSet<DiagnosticAnalyzer>? _lowPriorityAnalyzers; 117private HashSet<string>? _lowPriorityAnalyzerSupportedDiagnosticIds;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
171void AddCorrespondingDirectives(SyntaxNode member, HashSet<SyntaxNode> directives) 259var spine = new HashSet<SyntaxNode>();
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
640ISyntaxFactsService syntaxFacts, SyntaxNode root, HashSet<string> allNamespaceNameParts)
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
161var handledFolders = new HashSet<string>(StringComparer.Ordinal);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
179var defaultNamespaceFromProjects = new HashSet<string?>(
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (2)
20protected abstract HashSet<string> GetInitializedMembers(SyntaxTree tree, int position, CancellationToken cancellationToken); 51var alreadyTypedMembers = GetInitializedMembers(semanticModel.SyntaxTree, position, cancellationToken);
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
30var preprocessorNames = new HashSet<string>(syntaxFacts.StringComparer);
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
39HashSet<string> namespaceInScope,
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (4)
23protected abstract Task AddCompletionItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, HashSet<string> namespacesInScope, CancellationToken cancellationToken); 60var namespacesInScope = GetNamespacesInScope(syntaxContext, cancellationToken); 64private static HashSet<string> GetNamespacesInScope(SyntaxContext syntaxContext, CancellationToken cancellationToken) 73var namespacesInScope = new HashSet<string>(importedNamespaces, syntaxFacts.StringComparer);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (3)
33protected override async Task AddCompletionItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, HashSet<string> namespacesInScope, CancellationToken cancellationToken) 119HashSet<string> namespacesInScope, 139HashSet<string> namespacesInScope,
Copilot\CopilotChangeAnalysis.cs (1)
56[property: DataMember(Order = 4)] Dictionary<string, HashSet<string>> DiagnosticIdToProviderName,
Copilot\ICopilotChangeAnalysisService.cs (1)
257var diagnosticIdToProviderName = new Dictionary<string, HashSet<string>>();
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
212var set = new HashSet<Diagnostic>(diagnosticsA, DiagnosticComparer.Instance);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (2)
209var spanSet = new HashSet<DocumentSpan>(); 289private static async Task AddLocationSpanAsync(Location location, Solution solution, HashSet<DocumentSpan> spanSet, MultiDictionary<Document, HighlightSpan> tagList, HighlightSpanKind kind, CancellationToken cancellationToken)
EditAndContinue\CommittedSolution.cs (1)
77private readonly HashSet<ProjectId> _staleProjects = [];
EditAndContinue\DebuggingSession.cs (1)
90private readonly HashSet<Guid> _modulesPreparedForUpdate = [];
EditAndContinue\EditSessionTelemetry.cs (4)
38private readonly HashSet<(ushort, ushort, Guid)> _rudeEdits = []; 39private readonly HashSet<string> _emitErrorIds = []; 40private readonly HashSet<Guid> _projectsWithValidDelta = []; 41private readonly HashSet<Guid> _projectsWithUpdatedBaselines = [];
EmbeddedLanguages\AbstractEmbeddedLanguageFeatureService.cs (1)
27protected readonly HashSet<int> SyntaxTokenKinds = [];
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
22private readonly HashSet<string> LanguageIdentifiers = new(languageIdentifiers, StringComparer.OrdinalIgnoreCase);
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
42private static readonly HashSet<string> s_typeNamesOfInterest =
EmbeddedLanguages\RegularExpressions\LanguageServices\EmbeddedCompletionContext.cs (1)
20private readonly HashSet<string> _names = [];
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (5)
27HashSet<string> methodNamesOfInterest) 38var methodNamesOfInterest = GetMethodNamesOfInterest(regexType, info.SyntaxFacts); 46private readonly HashSet<string> _methodNamesOfInterest = methodNamesOfInterest; 54private static HashSet<string> GetMethodNamesOfInterest(INamedTypeSymbol? regexType, ISyntaxFacts syntaxFacts) 56var result = syntaxFacts.IsCaseSensitive
EmbeddedLanguages\RegularExpressions\RegexParser.cs (3)
183RegexNode node, HashSet<EmbeddedDiagnostic> seenDiagnostics, ArrayBuilder<EmbeddedDiagnostic> diagnostics) 197private void CollectDiagnosticsWorker(RegexNode node, HashSet<EmbeddedDiagnostic> seenDiagnostics, ArrayBuilder<EmbeddedDiagnostic> diagnostics) 226HashSet<EmbeddedDiagnostic> seenDiagnostics, ImmutableArray<EmbeddedDiagnostic> from, ArrayBuilder<EmbeddedDiagnostic> to)
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
279HashSet<ProjectId> linkedProjectIds,
Extensions\ExtensionMessageHandlerService.cs (3)
58private readonly (HashSet<string> workspace, HashSet<string> document) _unregisteredHandlerNames_useOnlyUnderLock = ([], []); 201var unregisteredHandlerNames = isSolution
ExternalAccess\UnitTesting\Notification\AbstractGlobalOperationNotificationService.cs (2)
20private readonly HashSet<IDisposable> _registrations = []; 21private readonly HashSet<string> _operations = [];
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
217var set = new HashSet<string>();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
554using var pool = SharedPools.Default<HashSet<string>>().GetPooledObject();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (1)
196var uniqueIds = new HashSet<ProjectId>();
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (1)
158var set = new HashSet<PreviousNextTokenPair>();
ExtractMethod\Extensions.cs (1)
51var set = new HashSet<Diagnostic>(node.GetDiagnostics());
ExtractMethod\MethodExtractor.Analyzer.cs (4)
50protected virtual bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap) 427var candidates = new HashSet<ISymbol>(readInsideMap); 821ITypeSymbol type, HashSet<ITypeSymbol> visited, HashSet<ITypeParameterSymbol> typeParameters)
ExtractMethod\MethodExtractor.CodeGenerator.cs (2)
385protected static HashSet<SyntaxAnnotation> CreateVariableDeclarationToRemoveMap( 407var set = new HashSet<ITypeParameterSymbol>(AnalyzerResult.MethodTypeParametersInConstraintList);
FindUsages\AbstractFindUsagesService_FindImplementations.cs (3)
97var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 110var seenLocations = new HashSet<(string filePath, TextSpan span)>(); 129static bool AddedAllLocations(ISymbol implementation, HashSet<(string filePath, TextSpan span)> seenLocations)
InlineHints\AbstractInlineTypeHintsService.cs (1)
110HashSet<INamedTypeSymbol>? seenSymbols = null)
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (1)
382private readonly HashSet<ISymbol> _allSymbols = [];
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (2)
388var declaredVariables = semanticModel.GetAllDeclaredSymbols(currentStatement, cancellationToken); 430HashSet<ISymbol> referencedVariables,
NavigateTo\NavigateToSearcher.cs (6)
43private static readonly ObjectPool<HashSet<INavigateToSearchResult>> s_searchResultPool = new(() => new(NavigateToSearchResultComparer.Instance)); 235using var _1 = s_searchResultPool.GetPooledObject(out var seenItems); 349HashSet<INavigateToSearchResult> seenResults, 414HashSet<INavigateToSearchResult> seenItems, 432HashSet<INavigateToSearchResult> seenItems, 464HashSet<INavigateToSearchResult> seenItems,
PdbSourceDocument\DocumentDebugInfoReader.cs (1)
38var documentHandles = SymbolSourceDocumentFinder.FindDocumentHandles(entityHandle, _dllReader, _pdbReader);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (2)
64private readonly HashSet<ProjectId> _sourceLinkEnabledProjects = []; 76private readonly HashSet<DocumentId> _openedDocumentIds = [];
PdbSourceDocument\SymbolSourceDocumentFinder.cs (8)
14public static HashSet<DocumentHandle> FindDocumentHandles(EntityHandle handle, MetadataReader dllReader, MetadataReader pdbReader) 16var docList = new HashSet<DocumentHandle>(); 40private static void ProcessMethodDef(MethodDefinitionHandle methodDefHandle, MetadataReader dllReader, MetadataReader pdbReader, HashSet<DocumentHandle> docList, bool processDeclaringType) 72private static void ProcessEventDef(EventDefinitionHandle eventDefHandle, MetadataReader dllReader, MetadataReader pdbReader, HashSet<DocumentHandle> docList) 97private static void ProcessPropertyDef(PropertyDefinitionHandle propertyDefHandle, MetadataReader dllReader, MetadataReader pdbReader, HashSet<DocumentHandle> docList) 117private static void ProcessFieldDef(FieldDefinitionHandle fieldDefHandle, MetadataReader dllReader, MetadataReader pdbReader, HashSet<DocumentHandle> docList) 124private static void ProcessTypeDef(TypeDefinitionHandle typeDefHandle, MetadataReader dllReader, MetadataReader pdbReader, HashSet<DocumentHandle> docList, bool processContainingType = true) 154private static void AddDocumentsFromTypeDefinitionDocuments(TypeDefinitionHandle typeDefHandle, MetadataReader pdbReader, HashSet<DocumentHandle> docList)
PullMemberUp\MembersPuller.cs (1)
507var overrideMembersSet = new HashSet<ISymbol>();
QuickInfo\AbstractEmbeddedLanguageQuickInfoProvider.cs (1)
77public new HashSet<int> SyntaxTokenKinds => base.SyntaxTokenKinds;
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
200var symbolSet = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (3)
62var nodesToRemove = new HashSet<SyntaxNode>(); 168private void MergeNodesToRemove(HashSet<SyntaxNode> nodesToRemove) 170var candidateLocalDeclarationsToRemove = new HashSet<TLocalDeclarationStatement>();
Shared\Extensions\DocumentExtensions.cs (1)
57var totalItems = new HashSet<T>(comparer);
Shared\Utilities\ExtractTypeHelpers.cs (3)
141var allReferencedTypeParameters = new HashSet<ITypeParameterSymbol>(directlyReferencedTypeParameters); 201private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes) 226private static bool DoesTypeReferenceTypeParameter(ITypeSymbol type, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (4)
118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 136private readonly HashSet<IPropertySymbol> _propertiesWithShadowGetAccessorUsages = new(OriginalDefinitionSymbolEqualityComparer.Instance); 519using var _1 = s_originalDefinitionSymbolHashSetPool.GetPooledObject(out var symbolsReferencedInDocComments); 675HashSet<ISymbol> builder,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (11)
56private readonly ObjectPool<HashSet<string>> _fieldNamesPool = new(() => new(semanticFacts.SyntaxFacts.StringComparer)); 91SemanticModel semanticModel, IMethodSymbol accessor, HashSet<string> fieldNames, HashSet<IFieldSymbol> result, CancellationToken cancellationToken); 94HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken); 119var fieldNames = _fieldNamesPool.Allocate(); 221HashSet<string> fieldNames, 258HashSet<string> fieldNames, 275SemanticModel semanticModel, IMethodSymbol setMethod, HashSet<string> fieldNames, CancellationToken cancellationToken) 293HashSet<string> fieldNames, 329HashSet<string> fieldNames, 501HashSet<string> fieldNames,
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
141static bool ContainsLocalReference(HashSet<ILocalSymbol> declaredPatternSymbols, IOperation? target)
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (2)
58var whenTrueSymbols = semanticModel.GetAllDeclaredSymbols(whenTrue.Syntax, cancellationToken, n => !syntaxFacts.IsAnonymousOrLocalFunction(n)); 59var whenFalseSymbols = semanticModel.GetAllDeclaredSymbols(whenFalse.Syntax, cancellationToken, n => !syntaxFacts.IsAnonymousOrLocalFunction(n));
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
440var methodParameterNames = new HashSet<string>(comparer);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
174private static bool IsTypeLessAccessibleThanOtherType(ITypeSymbol? first, INamedTypeSymbol second, HashSet<ITypeSymbol> alreadyCheckingTypes)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
69HashSet<SyntaxNode> processedNodes,
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (5)
32protected abstract void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<TFieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators); 46var declarators = new HashSet<SyntaxNode>(); 47var fieldDeclarators = new HashSet<TFieldDeclarationSyntax>(); 95protected static void AdjustAndAddAppropriateDeclaratorsToRemove(SyntaxNode parentDeclaration, IEnumerable<SyntaxNode> childDeclarators, HashSet<SyntaxNode> declarators)
StackTraceExplorer\StackTraceExplorerService.cs (1)
97var potentialMatches = new HashSet<TextDocument>();
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (1)
141var invalidChars = new HashSet<char>(Path.GetInvalidFileNameChars());
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (1)
102var dependencyNames = new HashSet<string>();
UnusedReferences\UnusedReferencesRemover.cs (9)
34HashSet<string> usedAssemblyFilePaths = []; 35HashSet<string> usedProjectFileNames = []; 65HashSet<string> usedAssemblyFilePaths, 66HashSet<string> usedProjectFileNames, 130HashSet<string> usedAssemblyFilePaths, 131HashSet<string> usedProjectFileNames) 186HashSet<string> usedAssemblyFilePaths) 236internal static bool ContainsAnyCompilationAssembly(ReferenceInfo reference, HashSet<string> usedAssemblyFilePaths) 246internal static void RemoveAllCompilationAssemblies(ReferenceInfo reference, HashSet<string> usedAssemblyFilePaths)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
167var linkedFiles = new HashSet<DocumentId>(); 358HashSet<DocumentId> linkedDocuments,
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\RudeEditDiagnosticTests.cs (3)
27var arg0 = new HashSet<RudeEditKind>() 56var arg2 = new HashSet<RudeEditKind>() 69var arg3 = new HashSet<RudeEditKind>()
Microsoft.CodeAnalysis.InteractiveHost (11)
Interactive\Core\InteractiveHost.Service.cs (1)
734var uniqueDirectories = new HashSet<string>(directories);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
Microsoft.CodeAnalysis.LanguageServer (3)
HostWorkspace\LoadedProject.cs (2)
249var newItems = new HashSet<T>(loadedCollection, comparer); 250var oldItems = new HashSet<T>(comparer);
LanguageServerExportProviderBuilder.cs (1)
96var expectedErrorPartsSet = new HashSet<string>(["CSharpMapCodeService", "PythiaSignatureHelpProvider", "CopilotSemanticSearchQueryExecutor"]);
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (2)
757var seenTitles = new HashSet<string>(); 771private static UnifiedSuggestedActionSet? FilterActionSetByTitle(UnifiedSuggestedActionSet set, HashSet<string> seenTitles)
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (2)
224HashSet<PreviousPullResult> removedResults, 296private void HandleRemovedDocuments(RequestContext context, HashSet<PreviousPullResult> removedPreviousResults, BufferedProgress<TReport> progress)
Handler\References\FindUsagesLSPContext.cs (1)
66private readonly HashSet<(string? filePath, TextSpan span)> _referenceLocations = [];
LspServices\LspServices.cs (1)
33private readonly HashSet<IDisposable> _servicesToDispose = new(ReferenceEqualityComparer.Instance);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\HandlerProvider.cs (2)
52var methodHash = new HashSet<(string methodName, string language)>(); 119static void CheckForDuplicates(string methodName, string language, HashSet<(string methodName, string language)> existingMethods)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (71)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.PublicApiAnalyzers (59)
DeclarePublicApiAnalyzer.Impl.cs (1)
518var publicApiLinesForSiblingsOfSymbol = new HashSet<string>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Microsoft.CodeAnalysis.Remote.ServiceHub (28)
Host\AssetProvider.cs (3)
59AssetPath assetPath, HashSet<Checksum> checksums, Action<Checksum, T, TArg>? callback, TArg? arg, CancellationToken cancellationToken) where TArg : default 232AssetPath assetPath, Action<ProjectStateChecksums, HashSet<Checksum>, TArg> addAllChecksums, TArg arg) 245AssetPath assetPath, HashSet<Checksum> checksums, Action<Checksum, T, TArg>? callback, TArg? arg, CancellationToken cancellationToken)
Host\RemoteExportProviderBuilder.cs (1)
77var expectedErrorPartsSet = new HashSet<string>(["PythiaSignatureHelpProvider", "VSTypeScriptAnalyzerService", "CodeFixService"]);
Host\RemoteSolutionCache.cs (1)
160public void AddAllTo(HashSet<TSolution> solutions)
Host\RemoteWorkspace_SolutionCaching.cs (1)
121public async ValueTask AddPinnedSolutionsAsync(HashSet<Solution> solutions, CancellationToken cancellationToken)
Host\SolutionAssetCache.cs (1)
154private async ValueTask AddPinnedChecksumsAsync(HashSet<Checksum> pinnedChecksums, CancellationToken cancellationToken)
Host\TestUtils.cs (14)
25var set = new HashSet<Checksum>(); 48var allChecksumsFromRequest = await GetAllChildrenChecksumsAsync(checksumFromRequest).ConfigureAwait(false); 114async Task<HashSet<Checksum>> GetAllChildrenChecksumsAsync(Checksum solutionChecksum) 116var set = new HashSet<Checksum>(); 147private static void AddAllTo(DocumentStateChecksums documentStateChecksums, HashSet<Checksum> checksums) 243private static HashSet<Checksum> Flatten(SolutionCompilationStateChecksums checksums) 245var set = new HashSet<Checksum>(); 250private static HashSet<Checksum> Flatten(SolutionStateChecksums checksums) 252var set = new HashSet<Checksum>(); 257private static HashSet<Checksum> Flatten(ProjectStateChecksums checksums) 259var set = new HashSet<Checksum>(); 264private static HashSet<Checksum> Flatten(DocumentStateChecksums checksums) 266var set = new HashSet<Checksum>(); 271public static void AppendChecksums(this HashSet<Checksum> set, ChecksumCollection checksums)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (2)
361using var pooledObject = SharedPools.Default<HashSet<object>>().GetPooledObject(); 363var referenceSet = pooledObject.Object;
Services\DiagnosticAnalyzer\PerformanceQueue.cs (3)
69using var pooledSet = SharedPools.Default<HashSet<int>>().GetPooledObject(); 75var analyzerSet = pooledSet.Object; 149public void AppendAnalyzers(HashSet<int> analyzerSet)
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
48var namespaceInScopeSet = new HashSet<string>(namespaceInScope, syntaxFacts.StringComparer);
Services\ProcessTelemetry\RemoteProcessTelemetryService.cs (1)
81var functionIdsSet = new HashSet<FunctionId>(functionIds);
Microsoft.CodeAnalysis.Remote.Workspaces (7)
AbstractAssetProvider.cs (2)
27public abstract Task GetAssetsAsync<T, TArg>(AssetPath assetPath, HashSet<Checksum> checksums, Action<Checksum, T, TArg>? callback, TArg? arg, CancellationToken cancellationToken); 180public Task GetAssetsAsync<TArg>(AssetPath assetPath, HashSet<Checksum> checksums, Action<Checksum, T, TArg>? callback, TArg? arg, CancellationToken cancellationToken)
AbstractAssetProviderExtensions.cs (1)
20this AbstractAssetProvider assetProvider, AssetPath assetPath, HashSet<Checksum> checksums, CancellationToken cancellationToken)
SolutionAssetStorage.Scope.cs (4)
49using var _ = SharedPools.Default<HashSet<Checksum>>().GetPooledObject(out var checksumsToFind); 61static void AddChecksums(ReadOnlyMemory<Checksum> checksums, HashSet<Checksum> checksumsToFind) 69AssetPath assetPath, HashSet<Checksum> remainingChecksumsToFind, Action<Checksum, object, TArg> onAssetFound, TArg arg, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ResxSourceGenerator (59)
AbstractResxGenerator.cs (1)
151var names = new HashSet<string>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (1)
87var expectedNames = new HashSet<string>();
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (1)
72var expectedNames = new HashSet<string>();
Microsoft.CodeAnalysis.Scripting (3)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
59private HashSet<string> _lazySuppressedFiles;
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (2)
32private HashSet<object> _lazyVisitedObjects; 34private HashSet<object> VisitedObjects
Microsoft.CodeAnalysis.Test.Utilities (45)
Assert\AssertEx.cs (2)
479var expectedSet = new HashSet<T>(expected, comparer); 495var expectedSet = new HashSet<T>(expected);
Assert\AssertXml.cs (1)
177HashSet<XElement> children2Used = new HashSet<XElement>(ReferenceEqualityComparer.Instance);
CommonTestBase.cs (6)
597var topOperations = new HashSet<IOperation>(); 626private static void CollectTopOperations(SemanticModel model, SyntaxNode node, HashSet<IOperation> topOperations) 669var originalSet = new HashSet<IOperation>(operation.DescendantsAndSelf()); 670var clonedSet = new HashSet<IOperation>(clonedOperation.DescendantsAndSelf()); 681var set = new HashSet<IOperation>(root.DescendantsAndSelf()); 695SemanticModel semanticModel, HashSet<IOperation> set, SyntaxNode node)
CompilationVerifier.cs (2)
886internal static void EmitReferences(Compilation compilation, HashSet<string> fullNameSet, List<ModuleData> dependencies, AssemblyIdentity corLibIdentity) 959var fullNameSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Diagnostics\CommonDiagnosticAnalyzers.cs (3)
1699var namedTypes = new HashSet<ISymbol>(); 1718private readonly HashSet<SyntaxTree> _treeCallbackSet; 1721private readonly HashSet<SourceText> _textCallbackSet;
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (13)
47Dictionary<IFieldSymbol, HashSet<INamedTypeSymbol>> fieldsSourceTypes = new Dictionary<IFieldSymbol, HashSet<INamedTypeSymbol>>(); 54Dictionary<ILocalSymbol, HashSet<INamedTypeSymbol>> localsSourceTypes = new Dictionary<ILocalSymbol, HashSet<INamedTypeSymbol>>(); 162private static bool HasMoreSpecificSourceType<SymbolType>(SymbolType symbol, ITypeSymbol symbolType, Dictionary<SymbolType, HashSet<INamedTypeSymbol>> symbolsSourceTypes, out INamedTypeSymbol commonSourceType) 164if (symbolsSourceTypes.TryGetValue(symbol, out var sourceTypes)) 232private static void AssignTo(IOperation target, Dictionary<ILocalSymbol, HashSet<INamedTypeSymbol>> localsSourceTypes, Dictionary<IFieldSymbol, HashSet<INamedTypeSymbol>> fieldsSourceTypes, IOperation sourceValue) 237private static void AssignTo(IOperation target, Dictionary<ILocalSymbol, HashSet<INamedTypeSymbol>> localsSourceTypes, Dictionary<IFieldSymbol, HashSet<INamedTypeSymbol>> fieldsSourceTypes, ITypeSymbol sourceType) 252private static void AssignTo<SymbolType>(SymbolType target, ITypeSymbol targetType, Dictionary<SymbolType, HashSet<INamedTypeSymbol>> sourceTypes, IOperation sourceValue) 257private static void AssignTo<SymbolType>(SymbolType target, ITypeSymbol targetType, Dictionary<SymbolType, HashSet<INamedTypeSymbol>> sourceTypes, ITypeSymbol sourceType) 268if (!sourceTypes.TryGetValue(target, out var symbolSourceTypes))
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (4)
39HashSet<IFieldSymbol> assignedToFields = new HashSet<IFieldSymbol>(); 40HashSet<IFieldSymbol> mightBecomeReadOnlyFields = new HashSet<IFieldSymbol>(); 111private static void AssignTo(IOperation target, bool inConstructor, ITypeSymbol staticConstructorType, HashSet<IFieldSymbol> assignedToFields, HashSet<IFieldSymbol> mightBecomeReadOnlyFields)
Diagnostics\LocalCouldBeConstAnalyzer.cs (4)
42HashSet<ILocalSymbol> mightBecomeConstLocals = new HashSet<ILocalSymbol>(); 43HashSet<ILocalSymbol> assignedToLocals = new HashSet<ILocalSymbol>(); 114private static void AssignTo(IOperation target, HashSet<ILocalSymbol> assignedToLocals, HashSet<ILocalSymbol> mightBecomeConstLocals)
Diagnostics\TrackingDiagnosticAnalyzer.cs (4)
96public void VerifyAnalyzeNodeCalledForAllSyntaxKinds(HashSet<TLanguageKindEnum> expectedMissingSyntaxKinds) 99var actualSyntaxKinds = new HashSet<TLanguageKindEnum>(_callLog.Where(a => FilterByAbstractName(a, "SyntaxNode")).Select(e => e.SyntaxKind)); 100var savedSyntaxKindsPatterns = new HashSet<TLanguageKindEnum>(expectedMissingSyntaxKinds); 112public void VerifyOnCodeBlockCalledForAllSymbolAndMethodKinds(HashSet<SymbolKind> symbolKindsWithNoCodeBlocks = null, bool allowUnexpectedCalls = false)
Metadata\MetadataSignatureUnitTestHelper.cs (1)
145var distinctSignatures = new HashSet<string>();
Mocks\VirtualizedRelativePathResolver.cs (1)
17private readonly HashSet<string> _existingFullPaths;
Platform\Desktop\RuntimeAssemblyManager.cs (2)
55private readonly HashSet<Assembly> _loadedAssemblies; 64private readonly HashSet<string> _preloadedSet;
TargetFrameworkUtil.cs (1)
349var nameSet = new HashSet<string>(getNames(references), StringComparer.OrdinalIgnoreCase);
TestableFileSystem.cs (1)
57var set = new HashSet<string>(existingPaths, comparer);
Microsoft.CodeAnalysis.Threading.Package (9)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
Microsoft.CodeAnalysis.UnitTests (28)
CachingLookupTests.cs (1)
256HashSet<string> lookedUp = new HashSet<string>(comparer);
Collections\HashSet\ISet_Generic_Tests`1.cs (6)
135HashSet<T> expected = new HashSet<T>(set, GetIEqualityComparer()); 153HashSet<T> beforeOperation = new HashSet<T>(set, GetIEqualityComparer()); 160HashSet<T> expected = new HashSet<T>(comparer); 282HashSet<T> expected = new HashSet<T>(comparer); 297HashSet<T> expected = new HashSet<T>(set, comparer); 653HashSet<T> expected = new HashSet<T>(comparer);
Collections\ImmutableSegmentedHashSetTest.cs (1)
208var expectedSet = new HashSet<string>(set, set.KeyComparer);
Collections\ImmutableSegmentedListBuilderTest.cs (1)
195var elemsToRemove = new HashSet<int>() { 0, 1, 2, 3, 4, 5 };
Collections\ImmutableSetTest.cs (1)
492var uniqueValues = new HashSet<T>(values);
Collections\ImmutableSetTest.nonnetstandard.cs (4)
115var expectedSet = new HashSet<T>(set); 127var expectedSet = new HashSet<T>(set); 141var expected = new HashSet<T>(set); 153var expected = new HashSet<T>(set);
Collections\ImmutablesTestBase.cs (1)
181var ensureUniqueness = new HashSet<double>();
Collections\List\IEnumerable.Generic.Tests.cs (2)
603HashSet<T> firstValues = new HashSet<T>(count); 604HashSet<T> secondValues = new HashSet<T>(count);
Collections\List\IEnumerable.NonGeneric.Tests.cs (2)
297HashSet<object> firstValues = new HashSet<object>(count); 298HashSet<object> secondValues = new HashSet<object>(count);
Collections\TopologicalSortTests.cs (1)
214var seen = new HashSet<T>();
CorLibTypesTests.cs (1)
72var knownMissingTypes = new HashSet<SpecialType>()
FileSystem\RelativePathResolverTests.cs (2)
29var fs = new HashSet<string> 104var fs = new HashSet<string>
MetadataReferences\AssemblyIdentityTestBase.cs (2)
49internal static readonly HashSet<char> ClrInvalidCharacters = new HashSet<char> 58internal static readonly HashSet<char> ClrBackslashEscapedCharacters = new HashSet<char>
StrongNameProviderTests.cs (3)
27var fs = new HashSet<string> 78private readonly HashSet<string> _existingFullPaths; 79public VirtualStrongNameFileSystem(HashSet<string> existingFullPaths)
Microsoft.CodeAnalysis.VisualBasic (56)
Analysis\FlowAnalysis\AbstractRegionDataFlowPass.vb (1)
22Optional initiallyAssignedVariables As HashSet(Of Symbol) = Nothing,
Analysis\FlowAnalysis\DataFlowsInWalker.vb (4)
23Private Sub New(info As FlowAnalysisInfo, region As FlowAnalysisRegionInfo, unassignedVariables As HashSet(Of Symbol)) 28unassignedVariables As HashSet(Of Symbol), 30ByRef invalidRegionDetected As Boolean) As HashSet(Of Symbol) 50Private ReadOnly _dataFlowsIn As HashSet(Of Symbol) = New HashSet(Of Symbol)()
Analysis\FlowAnalysis\DataFlowsOutWalker.vb (6)
24Private ReadOnly _originalUnassigned As HashSet(Of Symbol) 28Private ReadOnly _assignedInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 32unassignedVariables As HashSet(Of Symbol), originalUnassigned As HashSet(Of Symbol), dataFlowsIn As ImmutableArray(Of ISymbol)) 41unassignedVariables As HashSet(Of Symbol), dataFlowsIn As ImmutableArray(Of ISymbol)) As HashSet(Of Symbol)
Analysis\FlowAnalysis\EntryPointsWalker.vb (1)
32Private ReadOnly _entryPoints As HashSet(Of LabelStatementSyntax) = New HashSet(Of LabelStatementSyntax)()
Analysis\FlowAnalysis\ReadWriteWalker.vb (8)
52Private ReadOnly _readInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 53Private ReadOnly _writtenInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 54Private ReadOnly _readOutside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 55Private ReadOnly _writtenOutside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 56Private ReadOnly _captured As HashSet(Of Symbol) = New HashSet(Of Symbol)() 57Private ReadOnly _capturedInside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 58Private ReadOnly _capturedOutside As HashSet(Of Symbol) = New HashSet(Of Symbol)() 126Private Sub NoteReceiverReadOrWritten(fieldAccess As BoundFieldAccess, readOrWritten As HashSet(Of Symbol))
Analysis\FlowAnalysis\UnassignedVariablesWalker.vb (2)
25Friend Overloads Shared Function Analyze(info As FlowAnalysisInfo) As HashSet(Of Symbol) 34Private ReadOnly _result As HashSet(Of Symbol) = New HashSet(Of Symbol)()
Binding\Binder_Imports.vb (2)
21Protected Sub New(members As HashSet(Of NamespaceOrTypeSymbol), 29Public ReadOnly Members As HashSet(Of NamespaceOrTypeSymbol)
Binding\Binder_Lookup.vb (8)
1023Dim processed As HashSet(Of InterfaceInfo) = Nothing 1379verified As HashSet(Of Symbol), 1494processed As HashSet(Of InterfaceInfo), 1650Dim processed As HashSet(Of InterfaceInfo) = Nothing 1692ByRef processedInterfaces As HashSet(Of InterfaceInfo), 1870processed As HashSet(Of InterfaceInfo), 2016processed As HashSet(Of InterfaceInfo), 2064Dim processed As HashSet(Of InterfaceInfo) = Nothing
Binding\ExecutableCodeBinder.vb (1)
209Private _boundSimpleNames As HashSet(Of Integer)
Lowering\AsyncRewriter\AsyncRewriter.vb (1)
275Dim rewrittenNodes As HashSet(Of BoundNode) = Nothing
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (1)
105rewrittenNodes As HashSet(Of BoundNode),
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (3)
74Friend containsLiftingLambda As HashSet(Of BoundNode) = New HashSet(Of BoundNode)() 86Friend needsParentFrame As HashSet(Of BoundNode) 104Friend capturedVariables As HashSet(Of Symbol) = New HashSet(Of Symbol)(ReferenceEqualityComparer.Instance)
Symbols\ArrayTypeSymbol.vb (1)
388Friend Overrides Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo
Symbols\ErrorTypeSymbol.vb (1)
41Friend Overrides Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo
Symbols\FieldSymbol.vb (1)
301Dim unificationCheckedTypes As HashSet(Of TypeSymbol) = Nothing
Symbols\InstanceTypeSymbol.vb (1)
197Friend NotOverridable Overrides Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo
Symbols\NamedTypeSymbol.vb (1)
1247partialClosure As HashSet(Of Symbol),
Symbols\SubstitutedNamedType.vb (2)
648Friend NotOverridable Overrides Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo 1019Friend NotOverridable Overrides Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo
Symbols\Symbol_Attributes.vb (1)
501uniqueAttributeTypes As HashSet(Of NamedTypeSymbol)) As Boolean
Symbols\TypeSymbol.vb (2)
180Private Shared Sub MakeAllInterfacesInternal(i As NamedTypeSymbol, visited As HashSet(Of NamedTypeSymbol), result As ArrayBuilder(Of NamedTypeSymbol)) 534Friend MustOverride Overloads Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo
Symbols\UnboundGenericType.vb (1)
336Friend NotOverridable Overrides Function GetUnificationUseSiteDiagnosticRecursive(owner As Symbol, ByRef checkedTypes As HashSet(Of TypeSymbol)) As DiagnosticInfo
Syntax\SyntaxReplacer.vb (7)
58Private ReadOnly _nodeSet As HashSet(Of SyntaxNode) 59Private ReadOnly _tokenSet As HashSet(Of SyntaxToken) 60Private ReadOnly _triviaSet As HashSet(Of SyntaxTrivia) 62Private ReadOnly _spanSet As HashSet(Of TextSpan) 96Private Shared ReadOnly s_noNodes As HashSet(Of SyntaxNode) = New HashSet(Of SyntaxNode)() 97Private Shared ReadOnly s_noTokens As HashSet(Of SyntaxToken) = New HashSet(Of SyntaxToken)() 98Private Shared ReadOnly s_noTrivia As HashSet(Of SyntaxTrivia) = New HashSet(Of SyntaxTrivia)()
Microsoft.CodeAnalysis.Workspaces (234)
Diagnostics\HostDiagnosticAnalyzers.cs (1)
284var seen = new HashSet<DiagnosticAnalyzer>(map1.Values.SelectMany(v => v));
Diagnostics\SkippedHostAnalyzersInfo.cs (2)
121HashSet<string> projectAnalyzerDiagnosticIds, 122HashSet<string> projectSuppressedDiagnosticIds,
ExternalAccess\Pythia\Api\PythiaObjectPool.cs (2)
28public static IDisposable GetInstance<T>(out HashSet<T> instance) 30var disposer = Default<HashSet<T>>().GetPooledObject();
FindSymbols\FindReferences\DependentProjectsFinder.cs (5)
193Solution solution, Project? sourceProject, HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, CancellationToken cancellationToken) 260HashSet<(Project project, bool hasInternalsAccess)> dependentProjects, 267HashSet<string>? internalsVisibleToSet = null; 284private static HashSet<string> GetInternalsVisibleToSet(IAssemblySymbol assembly) 286var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
FindSymbols\FindReferences\DependentTypeFinder.cs (28)
21using SymbolSet = HashSet<INamedTypeSymbol>; 65Func<INamedTypeSymbol, SymbolSet, bool> typeMatches, 107using var _1 = GetSymbolSet(out var result); 111using var _2 = GetSymbolSet(out var currentMetadataTypes); 114using var _3 = GetSymbolSet(out var currentSourceAndMetadataTypes); 153using var _ = GetSymbolSet(out var tempBuffer); 172using var _ = GetSymbolSet(out var tempBuffer); 190async Task AddDescendantSourceTypesInProjectAsync(SymbolSet result, Project project) 200using var _1 = GetSymbolSet(out var typesToSearchFor); 201using var _2 = GetSymbolSet(out var tempBuffer); 254SymbolSet result, 276async Task AddSourceTypesThatDeriveFromNameAsync(SymbolSet result, string name) 292async Task AddDescendantMetadataTypesInProjectAsync(SymbolSet result, Project project) 301using var _1 = GetSymbolSet(out var typesToSearchFor); 302using var _2 = GetSymbolSet(out var tempBuffer); 333SymbolSet metadataTypes, 337SymbolSet result) 376SymbolSet foundTypes, Func<Location, bool> assert, string message) 382private static void AddRange(SymbolSet foundTypes, SymbolSet result) 389private static void AddRange(SymbolSet foundTypes, SymbolSet currentTypes, Func<INamedTypeSymbol, bool> shouldContinueSearching) 513private static bool TypeHasBaseTypeInSet(INamedTypeSymbol type, SymbolSet set) 519private static bool TypeHasInterfaceInSet(INamedTypeSymbol type, SymbolSet set) 536SymbolSet result, 537SymbolSet typesToSearchFor, 538SymbolSet tempBuffer, 561public static PooledDisposer<PooledHashSet<INamedTypeSymbol>> GetSymbolSet(out SymbolSet instance)
FindSymbols\FindReferences\DependentTypeFinder_DerivedClasses.cs (1)
24static bool TypeMatches(INamedTypeSymbol type, HashSet<INamedTypeSymbol> set)
FindSymbols\FindReferences\DependentTypeFinder_DerivedInterfaces.cs (1)
25static bool TypeMatches(INamedTypeSymbol type, HashSet<INamedTypeSymbol> set)
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
37static bool TypeMatches(INamedTypeSymbol type, HashSet<INamedTypeSymbol> set)
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
29HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (3)
35ISymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken); 804TSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, 828ISymbol symbol, HashSet<string>? globalAliases, Project project,
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
22HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
57HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (1)
20HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\DynamicTypeSymbolReferenceFinder.cs (1)
27HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (1)
51HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
28HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (1)
20HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (1)
31HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (1)
54ISymbol symbol, HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
43HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (1)
55HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (1)
28HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (1)
23HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
49HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (1)
26HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\PreprocessingSymbolReferenceFinder.cs (1)
21HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (1)
34HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
109HashSet<string>? globalAliases,
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (1)
20HashSet<string>? globalAliases,
FindSymbols\FindReferences\FindReferencesDocumentState.cs (3)
17HashSet<string>? globalAliases) 19private static readonly HashSet<string> s_empty = []; 22public readonly HashSet<string> GlobalAliases = globalAliases ?? s_empty;
FindSymbols\FindReferences\StandardCallbacks.cs (1)
13public static readonly Action<T, HashSet<T>> AddToHashSet =
FindSymbols\SymbolFinder.cs (2)
166var result = new HashSet<TSymbol>(); 189var linkedSymbols = new HashSet<ISymbol> { symbol };
FindSymbols\SymbolTree\MetadataInfo.cs (2)
26public readonly HashSet<ProjectId> ReferencingProjects; 28public MetadataInfo(SymbolTreeInfo info, HashSet<ProjectId> referencingProjects)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
89var referencingProjects = new HashSet<ProjectId>(solution.Projects.Where(p => p.MetadataReferences.Contains(reference)).Select(p => p.Id));
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (2)
19private readonly HashSet<(string alias, string name, int arity, bool isGlobal)>? _aliasInfo; 27HashSet<(string alias, string name, int arity, bool isGlobal)>? aliasInfo,
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (14)
25public static readonly ObjectPool<HashSet<string>> StringLiteralHashSetPool = SharedPools.Default<HashSet<string>>(); 26public static readonly ObjectPool<HashSet<long>> LongLiteralHashSetPool = SharedPools.Default<HashSet<long>>(); 47GetIdentifierSet(ignoreCase, out var identifiers, out var escapedIdentifiers); 49var stringLiterals = StringLiteralHashSetPool.Allocate(); 50var longLiterals = LongLiteralHashSetPool.Allocate(); 52HashSet<(string alias, string name, int arity, bool isGlobal)>? aliasInfo = null; 328ref HashSet<(string alias, string name, int arity, bool isGlobal)>? aliasInfo, 356private static void GetIdentifierSet(bool ignoreCase, out HashSet<string> identifiers, out HashSet<string> escapedIdentifiers) 375private static void Free(bool ignoreCase, HashSet<string> identifiers, HashSet<string> escapedIdentifiers)
FindSymbols\SyntaxTree\SyntaxTreeIndex_Persistence.cs (1)
67HashSet<(string alias, string name, int arity, bool isGlobal)>? aliasInfo = null;
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (2)
19private readonly Lazy<HashSet<DeclaredSymbolInfo>> _declaredSymbolInfoSet; 38public HashSet<DeclaredSymbolInfo> DeclaredSymbolInfoSet => _declaredSymbolInfoSet.Value;
Log\AggregateLogger.cs (2)
25var set = new HashSet<ILogger>(); 67var set = new HashSet<ILogger>();
Remote\RemoteArguments.cs (2)
201internal sealed class SerializableSymbolGroup(HashSet<SerializableSymbolAndProjectId> symbols) : IEquatable<SerializableSymbolGroup> 204public readonly HashSet<SerializableSymbolAndProjectId> Symbols = [.. symbols];
Rename\ConflictEngine\ConflictingIdentifierTracker.cs (1)
17private readonly HashSet<SyntaxToken> _conflictingTokensToReport = [];
Rename\ConflictEngine\ConflictResolver.Session.cs (5)
117var documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(documentsByProject); 310HashSet<DocumentId> documentIdsForConflictResolution, 714var documentIds = new HashSet<DocumentId>(); 742HashSet<DocumentId> documentIds, 788HashSet<DocumentId> documentIdsToRename,
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
70var appliedTextSpans = new HashSet<TextSpan>(); 189var modifiedTokensInComplexifiedStatements = new HashSet<SyntaxToken>();
Shared\Extensions\ISymbolExtensions.cs (4)
224private static DocumentationComment GetDocumentationComment(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CultureInfo? preferredCulture, bool expandIncludes, bool expandInheritdoc, CancellationToken cancellationToken) 297private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 333private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 344private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken)
Shared\TestHooks\AsynchronousOperationListener.cs (1)
20private readonly HashSet<TaskCompletionSource<bool>> _pendingTasks = [];
Shared\Utilities\BloomFilter.cs (5)
53public BloomFilter(double falsePositiveProbability, bool isCaseSensitive, HashSet<string> values) 61HashSet<string> stringValues, 62HashSet<long> longValues) 303private void AddRange(HashSet<string> values) 311private void AddRange(HashSet<long> values)
Shared\Utilities\ExtensionOrderer.Graph.cs (2)
35var seenNodes = new HashSet<Node<TExtension, TMetadata>>(); 48HashSet<Node<TExtension, TMetadata>> seenNodes)
Shared\Utilities\ExtensionOrderer.Node.cs (2)
15public readonly HashSet<Node<TExtension, TMetadata>> ExtensionsBeforeMeSet = []; 21HashSet<Node<TExtension, TMetadata>> seenNodes)
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (3)
86private readonly Dictionary<string, HashSet<string>> _assemblySimpleNameToOriginalPathListMap = new(SimpleNameComparer.Comparer); 183if (!_assemblySimpleNameToOriginalPathListMap.TryGetValue(simpleName, out var set)) 351if (!_assemblySimpleNameToOriginalPathListMap.TryGetValue(requestedName.Name, out var set))
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Utilities\WeakSet`1.cs (1)
16private readonly HashSet<ReferenceHolder<T>> _values = [];
Workspace\ProjectSystem\ProjectSystemProject.cs (3)
60private readonly HashSet<string> _projectAnalyzerPaths = []; 65private readonly HashSet<string> _sdkCodeStyleAnalyzerPaths = []; 116private readonly HashSet<IDynamicFileInfoProvider> _dynamicFileInfoProvidersSubscribedTo = [];
Workspace\Solution\Checksum.cs (1)
129public static void AddIfNotNullChecksum(this HashSet<Checksum> checksums, Checksum checksum)
Workspace\Solution\ChecksumCollection.cs (3)
49public void AddAllTo(HashSet<Checksum> checksums) 59HashSet<Checksum> searchingChecksumsLeft, 92HashSet<Checksum> searchingChecksumsLeft,
Workspace\Solution\ChecksumsAndIds.cs (1)
102public void AddAllTo(HashSet<Checksum> checksums)
Workspace\Solution\ProjectChanges.cs (6)
26var oldRefs = new HashSet<ProjectReference>(OldProject.ProjectReferences); 38var newRefs = new HashSet<ProjectReference>(NewProject.ProjectReferences); 50var oldMetadata = new HashSet<MetadataReference>(OldProject.MetadataReferences); 62var newMetadata = new HashSet<MetadataReference>(NewProject.MetadataReferences); 74var oldAnalyzerReferences = new HashSet<AnalyzerReference>(OldProject.AnalyzerReferences); 86var newAnalyzerReferences = new HashSet<AnalyzerReference>(NewProject.AnalyzerReferences);
Workspace\Solution\ProjectDependencyGraph.cs (13)
292using var pooledObject = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 293var results = pooledObject.Object; 302private void ComputeTransitiveReferences(ProjectId project, HashSet<ProjectId> result) 344using var pooledObject = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 345var results = pooledObject.Object; 355private void ComputeReverseTransitiveReferences(ProjectId project, HashSet<ProjectId> results) 389using var seenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 398HashSet<ProjectId> seenProjects, 441using var seenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 450private void ComputeDependencySets(HashSet<ProjectId> seenProjects, List<IEnumerable<ProjectId>> results, CancellationToken cancellationToken) 458using var dependencySet = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 465using var topologicallySeenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 473private void ComputedDependencySet(ProjectId project, HashSet<ProjectId> result)
Workspace\Solution\ProjectDependencyGraph_AddProjectReference.cs (1)
108var newTransitiveReferences = new HashSet<ProjectId>(referencedProjectIds);
Workspace\Solution\SolutionChanges.cs (2)
65var oldAnalyzerReferences = new HashSet<AnalyzerReference>(_oldSolution.AnalyzerReferences); 77var newAnalyzerReferences = new HashSet<AnalyzerReference>(_newSolution.AnalyzerReferences);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
963var syntaxTreesInWorkspaceStates = new HashSet<SyntaxTree>(
Workspace\Solution\SolutionState_Checksum.cs (1)
98using var projectCone = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject();
Workspace\Solution\StateChecksums.cs (8)
58public void AddAllTo(HashSet<Checksum> checksums) 104HashSet<Checksum> searchingChecksumsLeft, 218public void AddAllTo(HashSet<Checksum> checksums) 258HashSet<Checksum> searchingChecksumsLeft, 376public void AddAllTo(HashSet<Checksum> checksums) 428HashSet<Checksum> searchingChecksumsLeft, 505public void AddAllTo(HashSet<Checksum> checksums) 514HashSet<Checksum> searchingChecksumsLeft,
Workspace\Workspace.cs (1)
369static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
Workspace\Workspace_Editor.cs (4)
24private readonly Dictionary<ProjectId, HashSet<DocumentId>> _projectToOpenDocumentsMap = []; 68HashSet<DocumentId>? openDocs; 183return _projectToOpenDocumentsMap.TryGetValue(documentId.ProjectId, out var openDocuments) && 200if (_projectToOpenDocumentsMap.TryGetValue(projectId, out var documentIds))
Microsoft.CodeAnalysis.Workspaces.MSBuild (16)
MSBuild\MSBuildProjectLoader.Worker.cs (2)
125var processedPaths = new HashSet<string>(PathUtilities.Comparer); 474var paths = new HashSet<string>(PathUtilities.Comparer);
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (6)
50private readonly ImmutableDictionary<string, HashSet<int>> _pathToIndicesMap; 55private readonly HashSet<int> _indicesToRemove; 67private static ImmutableDictionary<string, HashSet<int>> CreatePathToIndexMap(ImmutableArray<MetadataReference> metadataReferences) 69var builder = ImmutableDictionary.CreateBuilder<string, HashSet<int>>(PathUtilities.Comparer); 123if (filePath != null && _pathToIndicesMap.TryGetValue(filePath, out var indices)) 390if (_projectMap.TryGetIdsByProjectPath(projectReferencePath, out var projectReferenceIds))
MSBuild\ProjectMap.cs (8)
24private readonly Dictionary<string, HashSet<ProjectId>> _projectPathToProjectIdsMap; 44_projectPathToProjectIdsMap = new Dictionary<string, HashSet<ProjectId>>(PathUtilities.Comparer); 131if (!_projectPathToProjectIdsMap.TryGetValue(projectPath, out var projectIds)) 148if (projectPath is not null && TryGetIdsByProjectPath(projectPath, out var projectIds)) 160private bool TryFindOutputFileRefPathInProjectIdSet(string? outputRefFilePath, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result) 163private bool TryFindOutputFilePathInProjectIdSet(string? outputFilePath, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result) 166private static bool TryFindPathInProjectIdSet(string? path, Func<ProjectId, string?> getPathById, HashSet<ProjectId> set, [NotNullWhen(true)] out ProjectId? result) 196internal bool TryGetIdsByProjectPath(string projectPath, [NotNullWhen(true)] out HashSet<ProjectId>? ids)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (32)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
NetCoreTests.cs (6)
220var projectPaths = new HashSet<string>(); 221var outputFilePaths = new HashSet<string>(); 310var projectPaths = new HashSet<string>(); 311var outputFilePaths = new HashSet<string>(); 325var expectedNames = new HashSet<string>() 333var actualNames = new HashSet<string>();
SolutionGeneration.cs (1)
68var files = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
VisualStudioMSBuildWorkspaceTests.cs (1)
86var fileNames = new HashSet<string>(references.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Logging\TestTelemetryLogger.cs (1)
35public HashSet<TestScope> OpenedScopes = [];
Workspaces\TestWorkspace`1.cs (1)
632var documentFilePaths = new HashSet<string>();
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
FindReferencesTests.cs (3)
344var expectedMatchedLines = new HashSet<int> { 3, 13, 14 }; 412var projectIds = new HashSet<ProjectId>(); 674private static void Verify(ReferencedSymbol reference, HashSet<int> expectedMatchedLines)
UtilityTest\IntervalTreeTests.cs (4)
321var set1 = new HashSet<string>(GetIntervalsThatOverlapWith(tree, start, length).Select(i => i.Item3)); 322var set2 = new HashSet<string>(spans.Where(t => 328var set3 = new HashSet<string>(GetIntervalsThatIntersectWith(tree, start, length).Select(i => i.Item3)); 329var set4 = new HashSet<string>(spans.Where(t =>
Microsoft.CommonLanguageServerProtocol.Framework.Package (2)
HandlerProvider.cs (2)
52var methodHash = new HashSet<(string methodName, string language)>(); 119static void CheckForDuplicates(string methodName, string language, HashSet<(string methodName, string language)> existingMethods)
Microsoft.CSharp (5)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (1)
563HashSet<CType> distinctCallingTypes = new HashSet<CType>();
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (1)
744HashSet<Name> names = new HashSet<Name>();
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (1)
1613HashSet<CType> typeSet = new HashSet<CType>();
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (2)
20private static readonly HashSet<Type> s_typesWithConversionsLoaded = new HashSet<Type>(); 21private static readonly HashSet<NameHashKey> s_namesLoadedForEachType = new HashSet<NameHashKey>();
Microsoft.Data.Analysis (25)
DataFrame.Join.cs (8)
171private static HashSet<long> Merge(DataFrame retainedDataFrame, DataFrame supplementaryDataFrame, 186retainedJoinColumnNames, supplemetaryJoinColumnNames, out HashSet<long> supplementaryJoinColumnsNullIndices); 193string[] retainedJoinColumnNames, string[] supplemetaryJoinColumnNames, out HashSet<long> supplementaryJoinColumnsNullIndices) 231var newOccurrences = shrinkedRetainedColumn.GetGroupedOccurrences(supplementaryColumn, out HashSet<long> supplementaryColumnNullIndices); 275private static HashSet<long> PerformMerging(DataFrame retainedDataFrame, string[] retainedJoinColumnNames, 276Dictionary<long, ICollection<long>> occurrences, HashSet<long> supplementaryJoinColumnsNullIndices, 283HashSet<long> intersection = calculateIntersection ? new HashSet<long>() : null; 384var intersection = Merge(retainedDataFrame, supplementaryDataFrame, retainedJoinColumns, supplementaryJoinColumns, out retainedRowIndices, out supplementaryRowIndices, calculateIntersection: true);
DataFrameColumn.cs (3)
255public virtual Dictionary<TKey, ICollection<long>> GroupColumnValues<TKey>(out HashSet<long> nullIndices) => throw new NotImplementedException(); 263public abstract Dictionary<long, ICollection<long>> GetGroupedOccurrences(DataFrameColumn other, out HashSet<long> otherColumnNullIndices); 272protected Dictionary<long, ICollection<long>> GetGroupedOccurrences<TKey>(DataFrameColumn other, out HashSet<long> otherColumnNullIndices)
DataFrameColumns\ArrowStringDataFrameColumn.cs (4)
477Dictionary<string, ICollection<long>> groupedValues = GroupColumnValues<string>(out HashSet<long> _); 484Dictionary<string, ICollection<long>> dictionary = GroupColumnValues<string>(out HashSet<long> _); 489public override Dictionary<TKey, ICollection<long>> GroupColumnValues<TKey>(out HashSet<long> nullIndices) 697public override Dictionary<long, ICollection<long>> GetGroupedOccurrences(DataFrameColumn other, out HashSet<long> otherColumnNullIndices)
DataFrameColumns\StringDataFrameColumn.cs (4)
398Dictionary<string, ICollection<long>> groupedValues = GroupColumnValues<string>(out HashSet<long> _); 404Dictionary<string, ICollection<long>> dictionary = GroupColumnValues<string>(out HashSet<long> _); 408public override Dictionary<TKey, ICollection<long>> GroupColumnValues<TKey>(out HashSet<long> nullIndices) 534public override Dictionary<long, ICollection<long>> GetGroupedOccurrences(DataFrameColumn other, out HashSet<long> otherColumnNullIndices)
DataFrameColumns\VBufferDataFrameColumn.cs (1)
180public override Dictionary<long, ICollection<long>> GetGroupedOccurrences(DataFrameColumn other, out HashSet<long> otherColumnNullIndices)
IDataView.Extension.cs (1)
51HashSet<string> selectColumnsSet = null;
PrimitiveDataFrameColumn.cs (4)
383Dictionary<T, ICollection<long>> groupedValues = GroupColumnValues<T>(out HashSet<long> _); 609Dictionary<T, ICollection<long>> dictionary = GroupColumnValues<T>(out HashSet<long> _); 613public override Dictionary<TKey, ICollection<long>> GroupColumnValues<TKey>(out HashSet<long> nullIndices) 923public override Dictionary<long, ICollection<long>> GetGroupedOccurrences(DataFrameColumn other, out HashSet<long> otherColumnNullIndices)
Microsoft.Data.Analysis.Tests (4)
DataFrame.IOTests.cs (1)
1653HashSet<Type> possibleTypes = new HashSet<Type>(types);
DataFrameTests.cs (1)
712HashSet<int?> uniqueRowValues = new HashSet<int?>();
DataFrameTests.Merge.cs (2)
770HashSet<int> intersection = new HashSet<int>(); 786HashSet<int> intersection = new HashSet<int>();
Microsoft.DotNet.ArcadeLogging (2)
PipelinesLogger.cs (2)
24private readonly HashSet<Guid> _detailedLoggedSet = new HashSet<Guid>(); 25private HashSet<string> _ignoredTargets;
Microsoft.DotNet.Build.Manifest (1)
VersionIdentifier.cs (1)
14private static readonly HashSet<string> _knownTags = new HashSet<string>
Microsoft.DotNet.Build.Tasks.Feed (39)
src\common\LatestLinksManager.cs (2)
50HashSet<string> assetsToPublish, 72public IEnumerable<AkaMSLink> GetLatestLinksToCreate(HashSet<string> assetsToPublish, TargetFeedConfig feedConfig, string feedBaseUrl)
src\PublishArtifactsInManifestBase.cs (33)
180public readonly Dictionary<TargetFeedContentType, HashSet<TargetFeedConfig>> FeedConfigs = 181new Dictionary<TargetFeedContentType, HashSet<TargetFeedConfig>>(); 183public readonly Dictionary<TargetFeedContentType, HashSet<PackageArtifactModel>> PackagesByCategory = 184new Dictionary<TargetFeedContentType, HashSet<PackageArtifactModel>>(); 186public readonly Dictionary<TargetFeedContentType, HashSet<BlobArtifactModel>> BlobsByCategory = 187new Dictionary<TargetFeedContentType, HashSet<BlobArtifactModel>>(); 375var packages = packagesPerCategory.Value; 377if (FeedConfigs.TryGetValue(category, out HashSet<TargetFeedConfig> feedConfigsForCategory)) 388HashSet<PackageArtifactModel> filteredPackages = SplitPackageByAssetSelection(packages, feedConfig); 428HashSet<BlobArtifactModel> symbolAssets, 503HashSet<BlobArtifactModel> symbolPackages) 537var symbolPackagesToPublish = BlobsByCategory.TryGetValue(TargetFeedContentType.Symbols, out HashSet<BlobArtifactModel> symbolAssets) ? 549HashSet<TargetFeedConfig> feedConfigsForSymbols = FeedConfigs[TargetFeedContentType.Symbols]; 699HashSet<string> packageFileExclusions = []; 793public SymbolPublishVisibility GetSymbolPublishingVisibility(HashSet<TargetFeedConfig> feedConfigsForSymbols) 822var packages = packagesPerCategory.Value; 824if (FeedConfigs.TryGetValue(category, out HashSet<TargetFeedConfig> feedConfigsForCategory)) 828HashSet<PackageArtifactModel> filteredPackages = SplitPackageByAssetSelection(packages, feedConfig); 867protected virtual HashSet<PackageArtifactModel> SplitPackageByAssetSelection(HashSet<PackageArtifactModel> packages, TargetFeedConfig feedConfig) 1042var blobs = blobsPerCategory.Value; 1044if (FeedConfigs.TryGetValue(category, out HashSet<TargetFeedConfig> feedConfigsForCategory)) 1048HashSet<BlobArtifactModel> filteredBlobs = FilterBlobs(blobs, feedConfig); 1086private HashSet<BlobArtifactModel> FilterBlobs(HashSet<BlobArtifactModel> blobs, TargetFeedConfig feedConfig) 1169HashSet<PackageArtifactModel> packagesToPublish, 1204HashSet<PackageArtifactModel> packagesToPublish, 1291HashSet<PackageArtifactModel> packagesToPublish, 1312HashSet<T> packagesToPublish, 1544private async Task PublishAssetsAsync(IAssetPublisher assetPublisher, HashSet<BlobArtifactModel> blobAssets, 1593HashSet<BlobArtifactModel> assetsToPublish, 1685HashSet<BlobArtifactModel> assetsToPublish,
src\PublishArtifactsInManifestV4.cs (2)
224protected override HashSet<PackageArtifactModel> SplitPackageByAssetSelection(HashSet<PackageArtifactModel> packages, TargetFeedConfig feedConfig)
src\PublishBuildToMaestro.cs (1)
191var targetChannelIds = new HashSet<int>(defaultChannels.Select(dc => dc.Channel.Id));
src\PublishSignedAssets.cs (1)
84HashSet<PackageIdentity> packagesToPublish = new HashSet<PackageIdentity>(
Microsoft.DotNet.Build.Tasks.Feed.Tests (7)
LatestLinksManagerTests.cs (4)
82var assetsToPublish = new HashSet<string> 126var assetsToPublish = new HashSet<string> { "assets/symbols/Microsoft.stuff.symbols.nupkg", "assets/Microsoft.stuff.zip", "assets/Microsoft.stuff.json", "assets/Microsoft.stuff.json.zip" }; 156var assetsToPublish = new HashSet<string> { "assets/symbols/Microsoft.stuff.symbols.nupkg", "assets/Microsoft.stuff.zip", "assets/Microsoft.stuff.json", "assets/Microsoft.stuff.json.zip" }; 193var assetsToPublish = new HashSet<string> { "assets/symbols/Microsoft.stuff.symbols.nupkg", "bar/Microsoft.stuff.zip", "assets/Microsoft.stuff.json", "assets/plop/Microsoft.stuff.json.zip" };
PublishToSymbolServerTest.cs (3)
44var feedConfigsForSymbols = new HashSet<TargetFeedConfig> 80HashSet<TargetFeedConfig> feedConfigsForSymbols = []; 203HashSet<TargetFeedConfig> feedConfigsForSymbols = [
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateRpmPackage.cs (1)
112HashSet<string> ownedDirectories = new(OwnedDirectories.Select(d => d.ItemSpec));
Microsoft.DotNet.Build.Tasks.Packaging (33)
ApplyMetaPackages.cs (7)
58var suppressMetaPackages = new Dictionary<string, HashSet<string>>(); 64if (!suppressMetaPackages.TryGetValue(metapackage.ItemSpec, out var value)) 95Dictionary<string, HashSet<NuGetFramework>> metaPackagesToAdd = new Dictionary<string, HashSet<NuGetFramework>>(); 107HashSet<NuGetFramework> metaPackageFrameworks; 129private bool ShouldSuppressMetapackage(Dictionary<string, HashSet<string>> suppressedMetaPackages, string metaPackage, NuGetFramework tfm) => 130suppressedMetaPackages.TryGetValue(metaPackage, out var value) &&
FilterUnknownPackages.cs (1)
46var baseLinePackageIds = new HashSet<string>(BaseLinePackages.NullAsEmpty().Select(b => b.ItemSpec));
GeneratePackageReport.cs (2)
20private HashSet<string> _unusedTargetPaths; 183private static HashSet<string> s_ignoredFrameworks = new HashSet<string>()
GetLayoutFiles.cs (1)
77HashSet<string> rids = null;
GetPackageDestination.cs (1)
76var suppressions = new HashSet<NuGetFramework>(
HarvestPackage.cs (4)
298var preserveRefVersion = new HashSet<Version>(desktopLibVersions); 505private HashSet<string> _pathsToExclude = null; 517private HashSet<string> _pathsNotIncluded = null; 529private HashSet<string> _pathsToSuppress = null;
PackageIndex.cs (2)
33public HashSet<string> IndexSources { get; set; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 369public HashSet<Version> StableVersions { get; set; } = new HashSet<Version>();
UpdatePackageIndex.cs (2)
21private HashSet<string> _packageIdsToInclude; 287var assmVersions = new HashSet<Version>(assemblyVersions.NullAsEmpty().Where(v => v != null));
ValidateFrameworkPackage.cs (2)
44var permittedInbox = GetSuppressionValues(Suppression.PermitInbox) ?? new HashSet<string>(); 69var permittedMissingInbox = GetSuppressionValues(Suppression.PermitMissingInbox) ?? new HashSet<string>();
ValidatePackage.cs (3)
171var runtimeFxSuppression = GetSuppressionValues(Suppression.PermitRuntimeTargetMonikerMismatch) ?? new HashSet<string>(); 389var assemblyVersions = new HashSet<Version>(allAssemblies.Select(f => VersionUtility.As4PartVersion(f.Version))); 494HashSet<NuGetFramework> explicitlySupportedFrameworks = new HashSet<NuGetFramework>(NuGetFramework.Comparer);
ValidationTask.cs (8)
46private Dictionary<Suppression, HashSet<string>> _suppressions; 57protected HashSet<string> GetSuppressionValues(Suppression key) 59HashSet<string> values; 66var values = GetSuppressionValues(key); 78HashSet<string> values; 88HashSet<string> values; 99_suppressions = new Dictionary<Suppression, HashSet<string>>(); 113HashSet<string> values = null;
Microsoft.DotNet.Build.Tasks.Packaging.Tests (1)
CreateTrimDependencyGroupsTests.cs (1)
343var expectedTFMs = new HashSet<string>()
Microsoft.DotNet.Build.Tasks.Workloads (5)
BuildData.wix.cs (1)
26public Dictionary<string, HashSet<ReleaseVersion>> FeatureBands = new();
CreateVisualStudioWorkload.wix.cs (2)
138HashSet<SwixComponent> swixComponents = new(); 139HashSet<SwixPackageGroup> swixPackageGroups = new();
CreateVisualStudioWorkloadSet.wix.cs (1)
44HashSet<SwixPackageGroup> swixPackageGroups = new();
Wix\WixToolTaskBase.cs (1)
16private HashSet<string> _extensions = new();
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\MembersMustExistAnalyzer.cs (1)
23private HashSet<string> _apisToEnsureExist = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Analyzers\PinvokeAnalyzer.cs (1)
67private HashSet<string> _isNotSupportedOnWin7 = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.GenFacades (7)
SourceGenerator.cs (2)
19private readonly HashSet<string> _ignoreMissingTypesList = new HashSet<string>(); 55HashSet<string> existingTypes = compileFiles != null ? TypeParser.GetAllPublicTypes(compileFiles, constants, langVersion) : null;
TypeParser.cs (5)
16public static HashSet<string> GetAllPublicTypes(IEnumerable<string> files, IEnumerable<string> constants, string langVersion) 18HashSet<string> types = new HashSet<string>(); 37private static void AddTypesFromTypeForwards(SyntaxTree tree, HashSet<string> types) 56private static void AddBaseTypes(SyntaxTree tree, HashSet<string> types) 70private static void AddTypesFromDelegates(SyntaxTree tree, HashSet<string> types)
Microsoft.DotNet.Helix.JobSender (1)
Payloads\AdhocPayload.cs (1)
54var filesSeen = new HashSet<string>();
Microsoft.DotNet.Helix.Sdk (3)
CheckAzurePipelinesTestResults.cs (1)
223HashSet<string> expectedFailures = ExpectedTestFailures?.Select(i => i.GetMetadata("Identity")).ToHashSet() ?? new HashSet<string>();
ProvisioningProfileProvider.cs (2)
126HashSet<string> rootLevelAppBundles = new(); 127HashSet<string> appBundlesWithProfile = new();
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\AssertEx.cs (2)
260var expectedSet = new HashSet<T>(expected, comparer); 275var expectedSet = new HashSet<T>(expected);
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Microsoft.DotNet.PackageTesting (4)
GetCompatiblePackageTargetFrameworks.cs (1)
17private static Dictionary<NuGetFramework, HashSet<NuGetFramework>> packageTfmMapping = new();
VerifyClosure.cs (2)
42private HashSet<string> otherFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 352var nodeIds = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
VerifyTypes.cs (1)
34private HashSet<string> ignoredTypes = new HashSet<string>();
Microsoft.DotNet.SharedFramework.Sdk (6)
src\CreateFrameworkListFile.cs (2)
75var singleFileHostIncludeFilenames = SingleFileHostIncludeFilenames?.ToHashSet(); 77var usedFileClasses = new HashSet<string>();
src\FileUtilities.cs (1)
16private static readonly HashSet<string> s_assemblyExtensions = new HashSet<string>(
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (2)
42private HashSet<string> otherFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 352var nodeIds = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (1)
34private HashSet<string> ignoredTypes = new HashSet<string>();
Microsoft.DotNet.SignCheckLibrary (11)
Verification\Exclusion.cs (11)
21private Dictionary<string, HashSet<string>> _fileExcludedCache = new(); 22private Dictionary<string, HashSet<string>> _fileNotExcludedCache = new(); 23private Dictionary<string, HashSet<string>> _parentExcludedCache = new(); 24private Dictionary<string, HashSet<string>> _parentNotExcludedCache = new(); 130Dictionary<string, HashSet<string>> cache = isExcluded ? _fileExcludedCache : _fileNotExcludedCache; 136Dictionary<string, HashSet<string>> cache = isExcluded ? _parentExcludedCache : _parentNotExcludedCache; 141Dictionary<string, HashSet<string>> excludedCache, 142Dictionary<string, HashSet<string>> notExcludedCache, 163private void AddToCache(Dictionary<string, HashSet<string>> cache, string key, IEnumerable<string> values) 179private bool IsInCache(Dictionary<string, HashSet<string>> cache, string key, IEnumerable<string> values) 180=> cache.TryGetValue(key, out var cachedValues) && values.Any(cachedValues.Contains);
Microsoft.DotNet.SignTool (15)
src\BatchSignUtil.cs (2)
119var toRepackSet = _batchData.FilesToSign.Where(x => x.ShouldRepack)?.Select(x => x.FullPath)?.ToHashSet(); 121var trackedSet = new HashSet<SignedFileContentKey>();
src\Configuration.cs (9)
68private readonly Dictionary<SignedFileContentKey, HashSet<string>> _whichPackagesTheFileIsIn; 73private readonly Dictionary<SigningToolErrorCode, HashSet<SignedFileContentKey>> _errors; 107private readonly HashSet<string> _itemsToSkip3rdPartyCheck; 117HashSet<string> itemsToSkip3rdPartyCheck, 143_whichPackagesTheFileIsIn = new Dictionary<SignedFileContentKey, HashSet<string>>(); 144_errors = new Dictionary<SigningToolErrorCode, HashSet<SignedFileContentKey>>(); 162if (!_whichPackagesTheFileIsIn.TryGetValue(fileUniqueKey, out var packages)) 620if (!_errors.TryGetValue(code, out var filesErrored)) 788if (!_whichPackagesTheFileIsIn.TryGetValue(fileUniqueKey, out var packages))
src\SignToolConstants.cs (2)
38public static readonly HashSet<string> SignableExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) 124public static readonly HashSet<string> MacSigningOperationsRequiringZipping =
src\SignToolTask.cs (2)
243var filesToSkip3rdPartyCheck = ItemsToSkip3rdPartyCheck?.Select(i => i.ItemSpec).ToHashSet(StringComparer.OrdinalIgnoreCase); 416private readonly HashSet<string> specialExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
Microsoft.DotNet.SignTool.Tests (2)
SignToolTests.cs (2)
383HashSet<string> skip3rdPartyCheckFiles = null, 1001var noWarn3rdPartySet = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "EmptyPKT.dll" };
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\WritePackageUsageData.cs (1)
191var properties = new HashSet<string>(
src\UsageReport\WriteUsageReports.cs (1)
91var poisonNupkgFilenames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Microsoft.DotNet.XliffTasks (6)
Model\VsctDocument.cs (4)
18HashSet<string> nonUniqueIds = FindNonUniqueIds(); 59private HashSet<string> FindNonUniqueIds() 61HashSet<string> idsAlreadySeen = new(); 62HashSet<string> conflictingIds = new();
Tasks\GatherXlf.cs (2)
30HashSet<string> outputPaths = new(StringComparer.OrdinalIgnoreCase); 51private string GetTranslatedOutputPath(ITaskItem source, string language, HashSet<string> outputPaths)
Microsoft.DotNet.XUnitAssert.Tests (85)
CollectionAssertsTests.cs (24)
1498 var expected = new HashSet<int> { 42, 2112 }; 1499 var actual = new HashSet<int> { 2112, 42 }; 1512 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 1513 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 1525 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 1526 var actual = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 1534 var expected = new HashSet<int> { 42, 2112 }; 1535 var actual = new HashSet<int> { 2600, 42 }; 1552 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 1553 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, true }) }; 1569 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 1570 var actual = new HashSet<BitArray> { new BitArray(new[] { true, true }) }; 2165 var expected = new HashSet<int> { 42, 2112 }; 2166 var actual = new HashSet<int> { 2112, 42 }; 2187 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 2188 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 2208 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 2209 var actual = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 2225 var expected = new HashSet<int> { 42, 2112 }; 2226 var actual = new HashSet<int> { 2600, 42 }; 2235 var expected = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, false }) }; 2236 var actual = new HashSet<BitArray>(comparer) { new BitArray(new[] { true, true }) }; 2244 var expected = new HashSet<BitArray> { new BitArray(new[] { true, false }) }; 2245 var actual = new HashSet<BitArray> { new BitArray(new[] { true, true }) };
EqualityAssertsTests.cs (32)
1221 var expected = new HashSet<int> { 1, 2, 3 }; 1222 var actual = new HashSet<int> { 1, 2, 3 }; 1230 var expected = new HashSet<int> { 1, 2, 3 }; 1231 var actual = new HashSet<int> { 1, 2, 4 }; 1247 var expected = new HashSet<int> { 1, 2, 3 }; 1248 var actual = new HashSet<int> { 2, 3, 1 }; 1256 var expected = new HashSet<int> { 1, 2, 3 }; 1257 var actual = new HashSet<int> { 2, 4, 1 }; 1273 var expected = new HashSet<int> { 1, 2, 3 }; 1274 var actual = new HashSet<int> { 1, 2 }; 1290 var expected = new HashSet<int> { 1, 2 }; 1291 var actual = new HashSet<int> { 1, 2, 3 }; 1307 var expected = new HashSet<string> { "bar", "foo" }; 1341 var expected = new HashSet<string> { "bar" }; 1342 var actual = new HashSet<string> { "baz" }; 1466 var actual = new HashSet<string> { "bar" }; 1479 var actual = new HashSet<string> { "baz" }; 1548 var actual = new HashSet<string> { "baz" }; 3450 var expected = new HashSet<int> { 1, 2, 3 }; 3451 var actual = new HashSet<int> { 1, 2, 3 }; 3467 var expected = new HashSet<int> { 1, 2, 3 }; 3468 var actual = new HashSet<int> { 1, 2, 4 }; 3476 var expected = new HashSet<int> { 1, 2, 3 }; 3477 var actual = new HashSet<int> { 2, 3, 1 }; 3493 var expected = new HashSet<int> { 1, 2, 3 }; 3494 var actual = new HashSet<int> { 2, 4, 1 }; 3502 var expected = new HashSet<string> { "bar", "foo" }; 3540 var expected = new HashSet<string> { "bar" }; 3541 var actual = new HashSet<string> { "baz" }; 3652 var actual = new HashSet<string> { "bar" }; 3678 var actual = new HashSet<string> { "baz" }; 3734 var actual = new HashSet<string> { "baz" };
SetAssertsTests.cs (28)
17 var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "forty-two" }; 34 var set = new HashSet<string>() { "eleventeen" }; 67 var set = new HashSet<string>() { "eleventeen" }; 84 var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "forty-two" }; 123 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 124 var actual = new HashSet<int> { 1, 2, 3 }; 140 var expectedSubset = new HashSet<int> { 1, 2, 3, 4 }; 141 var actual = new HashSet<int> { 1, 2, 3 }; 149 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 150 var actual = new HashSet<int> { 1, 2, 7 }; 189 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 190 var actual = new HashSet<int> { 1, 2, 3 }; 206 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 207 var actual = new HashSet<int> { 1, 2, 3, 4 }; 215 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 216 var actual = new HashSet<int> { 1, 2, 7 }; 255 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 256 var actual = new HashSet<int> { 1, 2, 3 }; 264 var expectedSubset = new HashSet<int> { 1, 2, 3, 4 }; 265 var actual = new HashSet<int> { 1, 2, 3 }; 273 var expectedSubset = new HashSet<int> { 1, 2, 3 }; 274 var actual = new HashSet<int> { 1, 2, 7 }; 313 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 314 var actual = new HashSet<int> { 1, 2, 3 }; 322 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 323 var actual = new HashSet<int> { 1, 2, 3, 4 }; 331 var expectedSuperset = new HashSet<int> { 1, 2, 3 }; 332 var actual = new HashSet<int> { 1, 2, 7 };
Utility\ReadOnlySet.cs (1)
8 readonly HashSet<T> hashSet;
Microsoft.DotNet.XUnitV3Extensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\SkippedTestCase.cs (1)
38Dictionary<string, HashSet<string>> traits = null,
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
804yield return new TestData<HashSet<string>>(["one", "two", "three"], """{"type":["array","null"],"items":{"type":["string","null"]}}"""); 1286[JsonSerializable(typeof(HashSet<string>))]
Microsoft.Extensions.AI.Evaluation (2)
CompositeEvaluator.cs (1)
47var metricNames = new HashSet<string>();
Utilities\TaskExtensions.cs (1)
65var remaining = new HashSet<Task<T>>(concurrentTasks);
Microsoft.Extensions.AI.Evaluation.Console (2)
Commands\CleanResultsCommand.cs (1)
60HashSet<string> toPreserve = [];
Utilities\ExceptionUtilities.cs (1)
24var seen = new HashSet<Exception>();
Microsoft.Extensions.AI.Evaluation.Integration.Tests (5)
ResultsTests.cs (5)
219var allowedValues = 275var allowedValues = 441HashSet<string> allowedValues = ["A", "B", "C"]; 494HashSet<string> allowedValues = ["A", "B", "C"]; 553HashSet<string> allowedValues = ["A", "B", "C"];
Microsoft.Extensions.AI.Evaluation.Quality (3)
IntentResolutionEvaluator.cs (1)
118var toolDefinitionNames = new HashSet<string>(context?.ToolDefinitions.Select(td => td.Name) ?? []);
TaskAdherenceEvaluator.cs (1)
117var toolDefinitionNames = new HashSet<string>(context?.ToolDefinitions.Select(td => td.Name) ?? []);
ToolCallAccuracyEvaluator.cs (1)
128var toolDefinitionNames = new HashSet<string>(context.ToolDefinitions.Select(td => td.Name));
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
227public HashSet<string> Required { get; set; } = [];
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIChatClientTests.cs (1)
665public HashSet<string> Required { get; set; } = [];
Microsoft.Extensions.ApiDescription.Client (3)
GetOpenApiReferenceMetadata.cs (2)
53var codeGenerators = new HashSet<string>(); 54var destinations = new HashSet<string>();
MetadataSerializer.cs (1)
21private static readonly HashSet<char> CharsToEscapeHash = new HashSet<char>(CharsToEscape);
Microsoft.Extensions.ApiDescription.Client.Tests (1)
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Microsoft.Extensions.AsyncState (5)
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.Compliance.Abstractions (7)
Classification\DataClassificationSet.cs (2)
17private readonly HashSet<DataClassification> _classifications = []; 80var combinedClassifications = new HashSet<DataClassification>(_classifications);
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.Compliance.Testing.Tests (2)
FakeRedactorTests.cs (2)
95var numbersSetRedacted = new HashSet<int>(sequenceNumbersRedacted); 96var numbersSetRequested = new HashSet<int>(sequenceNumbersRequested);
Microsoft.Extensions.Configuration.Binder (3)
ConfigurationBinder.cs (3)
229HashSet<string> propertyNames = new(modelProperties.Select(mp => mp.Name), 626HashSet<string> propertyNames = new(StringComparer.OrdinalIgnoreCase); 922Type genericType = typeof(HashSet<>).MakeGenericType(elementType);
Microsoft.Extensions.DependencyInjection (3)
CallSiteJsonFormatter.cs (2)
113private readonly HashSet<ServiceCallSite> _processedCallSites; 115public CallSiteFormatterContext(StringBuilder builder, int offset, HashSet<ServiceCallSite> processedCallSites)
ServiceLookup\CallSiteFactory.cs (1)
600HashSet<Type>? bestConstructorParameterTypes = null;
Microsoft.Extensions.DependencyInjection.AutoActivation (2)
AutoActivatorOptions.cs (2)
11public HashSet<Type> AutoActivators { get; } = []; 12public HashSet<(Type serviceType, object? serviceKey)> KeyedAutoActivators { get; } = [];
Microsoft.Extensions.DependencyModel (1)
DependencyContextWriter.cs (1)
262var dependencies = new HashSet<Dependency>();
Microsoft.Extensions.Diagnostics.HealthChecks (2)
DefaultHealthCheckService.cs (1)
165var distinctRegistrations = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
HealthCheckPublisherHostedService.cs (1)
107var delayPeriodGroups = new HashSet<(TimeSpan Delay, TimeSpan Period)>();
Microsoft.Extensions.Diagnostics.HealthChecks.Common (5)
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Linux\Resources\TestResources.cs (1)
38private readonly HashSet<string> _set = [];
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\MetricCollector.cs (1)
24private static readonly HashSet<Type> _supportedTs =
Microsoft.Extensions.FileProviders.Composite (1)
CompositeDirectoryContents.cs (1)
63var names = new HashSet<string>();
Microsoft.Extensions.FileSystemGlobbing (2)
Internal\MatcherContext.cs (2)
24private readonly HashSet<string> _declaredLiteralFolderSegmentInString; 25private readonly HashSet<LiteralPathSegment> _declaredLiteralFileSegments = new HashSet<LiteralPathSegment>();
Microsoft.Extensions.Http (1)
DependencyInjection\HttpClientBuilderExtensions.cs (1)
584var sensitiveHeaders = new HashSet<string>(redactedLoggedHeaderNames, StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.Http.Diagnostics (2)
Logging\LoggingOptions.cs (2)
94/// The default value is <see cref="HashSet{T}"/>. 109/// The default value is <see cref="HashSet{T}"/>.
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\LoggingOptionsTest.cs (2)
53var testContentTypes = new HashSet<string> { "application/xml" }; 63var testContentTypes = new HashSet<string> { "application/xml" };
Microsoft.Extensions.Http.Resilience (5)
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.Http.Resilience.Tests (1)
Routing\RoutingStrategyTest.cs (1)
44var strategies = new HashSet<RequestRoutingStrategy>();
Microsoft.Extensions.Localization (1)
ResourceManagerStringLocalizer.cs (1)
186var resourceNames = new HashSet<string>();
Microsoft.Extensions.Logging.Generators (4)
LoggerMessageGenerator.Parser.cs (3)
71var eventIds = new HashSet<int>(); 72var eventNames = new HashSet<string>(); 645HashSet<string> shadowedNames = new(StringComparer.Ordinal);
LoggerMessageGenerator.Roslyn3.11.cs (1)
50public HashSet<ClassDeclarationSyntax> ClassDeclarations { get; } = new();
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
59HashSet<object>? visited = null; 74private static bool TryValidateOptions(object options, string qualifiedName, List<ValidationResult> results, ref List<string>? errors, ref HashSet<object>? visited)
Microsoft.Extensions.Options.SourceGeneration (13)
Emitter.cs (6)
565private string GenerateStronglyTypedCodeForLengthAttributes(HashSet<object> data) 588private string GenerateStronglyTypedCodeForCompareAttribute(HashSet<object>? data) 629string linesToInsert = attributeData.Value is not null ? GenerateStronglyTypedCodeForLengthAttributes((HashSet<object>)attributeData.Value) : string.Empty; 634string linesToInsert = attributeData.Value is not null ? GenerateStronglyTypedCodeForLengthAttributes((HashSet<object>)attributeData.Value) : string.Empty; 639string linesToInsert = attributeData.Value is not null ? GenerateStronglyTypedCodeForLengthAttributes((HashSet<object>)attributeData.Value) : string.Empty; 644string linesToInsert = GenerateStronglyTypedCodeForCompareAttribute((HashSet<object>)attributeData.Value);
OptionsSourceGenContext.cs (3)
26internal Dictionary<string, HashSet<object>?> AttributesToGenerate { get; set; } = new Dictionary<string, HashSet<object>?>(); 28internal void EnsureTrackingAttribute(string attributeName, bool createValue, out HashSet<object>? value)
Parser.cs (4)
30private readonly HashSet<ITypeSymbol> _visitedModelTypes = new(SymbolEqualityComparer.Default); 277var addedMembers = new HashSet<string>(members.Select(m => m.Name)); 606_optionsSourceGenContext.EnsureTrackingAttribute(attributeType.Name, createValue: true, out HashSet<object>? trackedTypeList); 624_optionsSourceGenContext.EnsureTrackingAttribute(attribute.AttributeClass!.Name, createValue: true, out HashSet<object>? trackedTypeList);
Microsoft.Extensions.ServiceDiscovery (1)
ServiceDiscoveryHttpClientBuilderExtensions.cs (1)
56public HashSet<string?> ClientNames { get; } = new HashSet<string?>();
Microsoft.Extensions.Telemetry (6)
Latency\Internal\LatencyContextRegistrySet.cs (1)
60HashSet<string> keys = new HashSet<string>(names);
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.Telemetry.Abstractions (5)
src\Shared\Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
src\Shared\Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Microsoft.Extensions.TimeProvider.Testing (1)
FakeTimeProvider.cs (1)
20internal readonly HashSet<Waiter> Waiters = [];
Microsoft.Extensions.Validation.ValidationsGenerator (5)
Extensions\IncrementalValuesProviderExtensions.cs (1)
26HashSet<TSource> set = new(comparer);
Parsers\ValidationsGenerator.AttributeParser.cs (1)
22var validatableTypes = new HashSet<ValidatableType>(ValidatableTypeComparer.Instance);
Parsers\ValidationsGenerator.TypesParser.cs (3)
34var validatableTypes = new HashSet<ValidatableType>(ValidatableTypeComparer.Instance); 50internal bool TryExtractValidatableType(ITypeSymbol incomingTypeSymbol, WellKnownTypes wellKnownTypes, ref HashSet<ValidatableType> validatableTypes, ref List<ITypeSymbol> visitedTypes) 108internal ImmutableArray<ValidatableProperty> ExtractValidatableMembers(ITypeSymbol typeSymbol, WellKnownTypes wellKnownTypes, ref HashSet<ValidatableType> validatableTypes, ref List<ITypeSymbol> visitedTypes)
Microsoft.Gen.ComplianceReports (5)
src\Generators\Shared\GeneratorUtilities.cs (5)
45HashSet<string> fullyQualifiedAttributeNames, 51HashSet<string> fullyQualifiedAttributeNames, 56var shortAttributeNames = new HashSet<string>(); 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.ContextualOptions (5)
src\Generators\Shared\GeneratorUtilities.cs (5)
45HashSet<string> fullyQualifiedAttributeNames, 51HashSet<string> fullyQualifiedAttributeNames, 56var shortAttributeNames = new HashSet<string>(); 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.Logging (24)
Emission\Emitter.cs (1)
96var classificationAttrs = new HashSet<string>();
Emission\Emitter.Method.cs (1)
604private string MakeClassificationValue(HashSet<string> classificationTypes)
Model\LoggingMethod.cs (1)
47HashSet<string> templates = [];
Model\LoggingMethodParameter.cs (1)
34public HashSet<string> ClassificationAttributeTypes = [];
Model\LoggingProperty.cs (1)
15public HashSet<string> ClassificationAttributeTypes = [];
Parsing\Parser.cs (5)
45var ids = new HashSet<int>(); 46var eventNames = new HashSet<string>(); 481var names = new HashSet<string>(StringComparer.Ordinal); 559var paramDataClassAttributes = new HashSet<string>( 643HashSet<string> shadowedNames = new(StringComparer.Ordinal);
Parsing\Parser.LogProperties.cs (4)
20private static readonly HashSet<TypeKind> _allowedTypeKinds = [TypeKind.Class, TypeKind.Struct, TypeKind.Interface]; 51var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 92var seenProps = new HashSet<string>(); 162var classification = new HashSet<string>();
Parsing\Parser.Records.cs (3)
22var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 32private static bool RecordHasSensitivePublicMembers(ITypeSymbol type, HashSet<ITypeSymbol> typesChain, SymbolHolder symbols, CancellationToken token) 34var overriddenMembers = new HashSet<string>();
Parsing\SymbolHolder.cs (1)
22HashSet<INamedTypeSymbol> IgnorePropertiesSymbols,
Parsing\SymbolLoader.cs (1)
93var ignorePropsSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\GeneratorUtilities.cs (5)
45HashSet<string> fullyQualifiedAttributeNames, 51HashSet<string> fullyQualifiedAttributeNames, 56var shortAttributeNames = new HashSet<string>(); 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.MetadataExtractor (18)
src\Generators\Microsoft.Gen.Metrics\Model\MetricMethod.cs (1)
11public HashSet<string> TagKeys = [];
src\Generators\Microsoft.Gen.Metrics\Parser.cs (10)
34private static readonly HashSet<SpecialType> _allowedGenericAttributeTypeArgs = 66var metricNames = new HashSet<string>(); 276private (string metricName, HashSet<string> tagNames, Dictionary<string, string> dimensionDescriptions) ExtractAttributeParameters( 280var tagHashSet = new HashSet<string>(); 397HashSet<string> metricNames, 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 678HashSet<string> tagHashSet, 856HashSet<string> tagHashSet, 895HashSet<string> tagHashSet, 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Microsoft.Gen.Metrics\StrongTypeAttributeParameters.cs (1)
12public HashSet<string> TagHashSet = [];
src\Generators\Microsoft.Gen.MetricsReports\ReportedMetricClass.cs (1)
11internal readonly record struct ReportedMetricMethod(string MetricName, string Summary, InstrumentKind Kind, HashSet<string> Dimensions, Dictionary<string, string> DimensionsDescriptions);
src\Generators\Shared\GeneratorUtilities.cs (5)
45HashSet<string> fullyQualifiedAttributeNames, 51HashSet<string> fullyQualifiedAttributeNames, 56var shortAttributeNames = new HashSet<string>(); 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Gen.Metrics (18)
MetricsGenerator.cs (1)
17private static readonly HashSet<string> _attributeNames =
Model\MetricMethod.cs (1)
11public HashSet<string> TagKeys = [];
Parser.cs (10)
34private static readonly HashSet<SpecialType> _allowedGenericAttributeTypeArgs = 66var metricNames = new HashSet<string>(); 276private (string metricName, HashSet<string> tagNames, Dictionary<string, string> dimensionDescriptions) ExtractAttributeParameters( 280var tagHashSet = new HashSet<string>(); 397HashSet<string> metricNames, 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 678HashSet<string> tagHashSet, 856HashSet<string> tagHashSet, 895HashSet<string> tagHashSet, 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Shared\GeneratorUtilities.cs (5)
45HashSet<string> fullyQualifiedAttributeNames, 51HashSet<string> fullyQualifiedAttributeNames, 56var shortAttributeNames = new HashSet<string>(); 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
StrongTypeAttributeParameters.cs (1)
12public HashSet<string> TagHashSet = [];
Microsoft.Gen.MetricsReports (18)
ReportedMetricClass.cs (1)
11internal readonly record struct ReportedMetricMethod(string MetricName, string Summary, InstrumentKind Kind, HashSet<string> Dimensions, Dictionary<string, string> DimensionsDescriptions);
src\Generators\Microsoft.Gen.Metrics\Model\MetricMethod.cs (1)
11public HashSet<string> TagKeys = [];
src\Generators\Microsoft.Gen.Metrics\Parser.cs (10)
34private static readonly HashSet<SpecialType> _allowedGenericAttributeTypeArgs = 66var metricNames = new HashSet<string>(); 276private (string metricName, HashSet<string> tagNames, Dictionary<string, string> dimensionDescriptions) ExtractAttributeParameters( 280var tagHashSet = new HashSet<string>(); 397HashSet<string> metricNames, 632var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default); 678HashSet<string> tagHashSet, 856HashSet<string> tagHashSet, 895HashSet<string> tagHashSet, 909var typesChain = new HashSet<ITypeSymbol>(SymbolEqualityComparer.Default);
src\Generators\Microsoft.Gen.Metrics\StrongTypeAttributeParameters.cs (1)
12public HashSet<string> TagHashSet = [];
src\Generators\Shared\GeneratorUtilities.cs (5)
45HashSet<string> fullyQualifiedAttributeNames, 51HashSet<string> fullyQualifiedAttributeNames, 56var shortAttributeNames = new HashSet<string>(); 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken)
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
22private static readonly HashSet<string> s_unsupportedTypeNames = new()
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
183HashSet<Project> projectsToAddUnsafe = new();
Microsoft.Interop.LibraryImportGenerator (11)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
39private static readonly HashSet<string> s_unsupportedTypeNames =
Analyzers\CustomMarshallerAttributeFixer.cs (9)
32Dictionary<(INamedTypeSymbol marshallerType, ITypeSymbol managedType, bool isLinearCollectionMarshaller), HashSet<string>> uniqueMarshallersToFix = new(); 47if (!uniqueMarshallersToFix.TryGetValue(uniqueMarshallerFixKey, out HashSet<string> membersToAdd)) 63HashSet<string> missingMembers = marshallerInfo.Value; 130private static (HashSet<string> missingMembers, List<Diagnostic> fixedDiagnostics) GetRequiredShapeMissingMemberNames(IEnumerable<Diagnostic> diagnostics) 132HashSet<string> missingMemberNames = new(); 154private static async Task<Solution> AddMissingMembers(Document doc, SyntaxNode node, HashSet<string> missingMemberNames, CancellationToken ct) 191HashSet<string> missingMemberNames, 204private static void AddMissingMembersToStatelessMarshaller(DocumentEditor editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller) 400private static void AddMissingMembersToStatefulMarshaller(DocumentEditor editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
183HashSet<Project> projectsToAddUnsafe = new();
Microsoft.Maui (5)
Hosting\Internal\RegisteredHandlerServiceTypeSet.cs (3)
15 private readonly HashSet<Type> _concreteHandlerServiceTypeSet = new(); 16 private readonly HashSet<Type> _interfaceHandlerServiceTypeSet = new(); 45 private static Type? ResolveVirtualViewFromTypeSet(Type type, HashSet<Type> set)
Platform\ElementExtensions.cs (1)
35 static HashSet<Type> handlersWithConstructors = new HashSet<Type>();
WindowOverlay\WindowOverlay.cs (1)
22 readonly HashSet<IWindowOverlayElement> _windowElements = new();
Microsoft.Maui.Controls (17)
Application\Application.cs (1)
350 var innerKeys = new HashSet<string>(StringComparer.Ordinal);
Element\Element.cs (1)
634 HashSet<string> _pendingHandlerUpdatesFromBPSet = new HashSet<string>();
ListProxy.cs (1)
25 HashSet<int> _indexesCounted;
Routing.cs (3)
15 static HashSet<string> s_routeKeys; 137 internal static HashSet<string> GetRouteKeys() 139 var keys = s_routeKeys;
Shell\ShellUriHandler.cs (6)
230 var routeKeys = Routing.GetRouteKeys(); 347 HashSet<string> routeKeys, 432 HashSet<string> routeKeys) 530 static bool FindAndAddSegmentMatch(RouteRequestBuilder possibleRoutePath, HashSet<string> routeKeys) 607 internal static void ExpandOutGlobalRoutes(List<RouteRequestBuilder> possibleRoutePaths, HashSet<string> routeKeys) 975 var keys = Routing.GetRouteKeys();
TemplatedItemsList.cs (1)
1228 readonly HashSet<TemplatedItemsList<TView, TItem>> _attachedItems = new HashSet<TemplatedItemsList<TView, TItem>>();
View\View.cs (1)
143 HashSet<IGestureRecognizer> compositeGestureRecognizers = new(GestureController.CompositeGestureRecognizers);
VisualElement\VisualElement.cs (1)
1550 var innerKeys = new HashSet<string>(StringComparer.Ordinal);
VisualStateManager.cs (1)
156 readonly HashSet<string> _names = new HashSet<string>(StringComparer.Ordinal);
Window\Window.cs (1)
67 HashSet<IWindowOverlay> _overlays = new HashSet<IWindowOverlay>();
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (1)
166 private static readonly HashSet<string> knowValuesSet;
VisibilityDesignTypeConverter.cs (1)
10 private static readonly HashSet<string> supportedValues = new HashSet<string>(validValues, StringComparer.OrdinalIgnoreCase);
Microsoft.ML.AutoML (14)
AutoMLExperiment\ITrialResultManager.cs (2)
35private readonly HashSet<TrialResult> _trialResultsHistory; 38private readonly HashSet<TrialResult> _newTrialResults;
ColumnInference\ColumnTypeInference.cs (1)
327var usedNames = new HashSet<string>();
ColumnInference\PurposeInference.cs (1)
127var seen = new HashSet<string>();
DatasetDimensions\DatasetDimensionsUtil.cs (1)
16var seen = new HashSet<string>();
PipelineSuggesters\PipelineSuggester.cs (2)
56var visitedPipelines = new HashSet<SuggestedPipeline>(history.Select(h => h.Pipeline)); 113var selectedTrainerNames = new HashSet<TrainerName>(selectedTrainers.Select(t => t.TrainerName));
Sweepers\SmacSweeper.cs (2)
185HashSet<Tuple<double, ParameterSet>> configurations = new HashSet<Tuple<double, ParameterSet>>(); 204var retainedConfigs = new HashSet<ParameterSet>(bestConfigurations.Select(x => x.Item2));
Sweepers\SweeperBase.cs (2)
51var prevParamSets = new HashSet<ParameterSet>(previousRuns?.Select(r => r.ParameterSet).ToList() ?? new List<ParameterSet>()); 52var result = new HashSet<ParameterSet>();
TransformInference\TransformInference.cs (1)
479var existingColNames = new HashSet<string>(columns.Select(c => c.ColumnName));
Tuner\SmacTuner.cs (2)
196var configurations = new HashSet<Tuple<double, Parameter>>(); 211var retainedConfigs = new HashSet<Parameter>(orderedConfigurations.Select(x => x.Item2), comparer);
Microsoft.ML.CodeGenerator (7)
CodeGenerator\CSharp\CodeGenerator.cs (6)
27private static readonly HashSet<string> _recommendationTrainers = new HashSet<string>() { TrainerName.MatrixFactorization.ToString() }; 28private static readonly HashSet<string> _lightGbmTrainers = new HashSet<string>() { TrainerName.LightGbmBinary.ToString(), TrainerName.LightGbmMulti.ToString(), 30private static readonly HashSet<string> _mklComponentsTrainers = new HashSet<string>() { TrainerName.OlsRegression.ToString(), TrainerName.SymbolicSgdLogisticRegressionBinary.ToString() }; 31private static readonly HashSet<string> _fastTreeTrainers = new HashSet<string>() { TrainerName.FastForestBinary.ToString(), TrainerName.FastForestRegression.ToString(), 33private static readonly HashSet<string> _imageTransformers = new HashSet<string>() { EstimatorName.RawByteImageLoading.ToString() }; 34private static readonly HashSet<string> _imageClassificationTrainers = new HashSet<string>() { TrainerName.ImageClassification.ToString() };
Utils.cs (1)
329HashSet<String> columnNamesSet = new HashSet<String>(columnNames);
Microsoft.ML.Core (7)
ComponentModel\ComponentCatalog.cs (1)
440private readonly HashSet<string> _cachedAssemblies;
Data\ProgressReporter.cs (2)
316private readonly HashSet<string> _namesUsed; 438var seen = new HashSet<int>();
Utilities\SupervisedBinFinder.cs (2)
71var seenValues = new HashSet<Single>(); 149var seenValues = new HashSet<Double>();
Utilities\Utils.cs (2)
96public static int Size<T>(HashSet<T> x) 149public static bool Add<T>(ref HashSet<T> set, T item)
Microsoft.ML.Core.Tests (6)
UnitTests\CoreBaseTestClass.cs (1)
270HashSet<DataViewRowId> idsSeen = null;
UnitTests\TestEntryPoints.cs (2)
292var excludeSet = new HashSet<string>(); 309var variables = new HashSet<string>();
UnitTests\TestVBuffer.cs (3)
326var aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 799HashSet<int> aIndices = new HashSet<int>(a.Items().Select(iv => iv.Key)); 800HashSet<int> bIndices = new HashSet<int>(b.Items().Select(iv => iv.Key));
Microsoft.ML.Data (47)
Commands\TypeInfoCommand.cs (8)
84var dstToSrcMap = new Dictionary<HashSet<InternalDataKind>, HashSet<InternalDataKind>>(comp); 85var srcToDstMap = new Dictionary<InternalDataKind, HashSet<InternalDataKind>>(); 90HashSet<InternalDataKind> nonIdentity = null; 97var dstKinds = new HashSet<InternalDataKind>(); 111HashSet<InternalDataKind> srcKinds; 120var dsts = srcToDstMap[kinds[i]]; 121HashSet<InternalDataKind> srcs;
Data\DataViewTypeManager.cs (1)
26private static readonly HashSet<Type> _bannedRawTypes = new HashSet<Type>()
Data\SchemaDefinition.cs (2)
382internal static bool GetNameAndCustomAttributes(MemberInfo memberInfo, Type userType, HashSet<string> colNames, out string name, out IEnumerable<Attribute> customAttributes) 423HashSet<string> colNames = new HashSet<string>();
DataLoadSave\Binary\BinaryLoader.cs (1)
332var kinds = new HashSet<string>();
DataLoadSave\Binary\BinarySaver.cs (3)
275var kinds = new HashSet<string>(); 584HashSet<int> activeSet = new HashSet<int>(activeColumns.Select(col => col.SourceIndex)); 739HashSet<int> active = new HashSet<int>(actives.Select(cc => cc.SourceIndex));
DataLoadSave\Text\TextLoader.cs (2)
1213var separators = new HashSet<char>(); 1226var separators = new HashSet<char>();
DataView\CacheDataView.cs (2)
331HashSet<int> taskColumns = null; 667HashSet<OrderedWaiter> waiters = new HashSet<OrderedWaiter>();
DataView\Transposer.cs (2)
871var activeSrcSet = new HashSet<int>(); 1279var activeSrcSet = new HashSet<int>();
Evaluators\EvaluatorBase.cs (1)
80var stratIndices = Utils.Size(stratCols) > 0 ? new HashSet<int>(stratCols.Select(col => col.Index)) : new HashSet<int>();
Model\Pfa\BoundPfaContext.cs (5)
40private readonly HashSet<string> _unavailable; 45public BoundPfaContext(IHostEnvironment env, DataViewSchema inputSchema, HashSet<string> toDrop, bool allowSet) 59private void SetInput(DataViewSchema schema, HashSet<string> toDrop) 65var fieldNames = new HashSet<string>(); 119var fieldNames = new HashSet<string>();
Model\Pfa\PfaContext.cs (2)
22private readonly HashSet<string> _variables; 26private readonly HashSet<string> _types;
Model\Pfa\SavePfaCommand.cs (3)
61private readonly HashSet<string> _inputsToDrop; 62private readonly HashSet<string> _outputsToDrop; 86private static HashSet<string> CreateDropMap(string toDrop)
Scorers\RowToRowScorerBase.cs (1)
171var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Transforms\ColumnBindingsBase.cs (1)
688var namesUsed = new HashSet<string>();
Transforms\ColumnSelecting.cs (2)
281var names = new HashSet<string>(); 353var names = new HashSet<string>();
Transforms\InvertHashUtils.cs (5)
153private readonly Dictionary<int, HashSet<Pair>> _slotToValueSet; 182_slotToValueSet = new Dictionary<int, HashSet<Pair>>(); 186private ReadOnlyMemory<char> Textify(ref StringBuilder sb, ref StringBuilder temp, ref char[] cbuffer, ref Pair[] buffer, HashSet<Pair> pairs) 274HashSet<Pair> pairSet; 289HashSet<Pair> pairSet;
Transforms\MetadataDispatcher.cs (2)
219HashSet<string> kinds = null; 366var set = new HashSet<string>(kindsSrc);
Transforms\OneToOneTransformerBase.cs (1)
23var newNames = new HashSet<string>();
Transforms\TransformBase.cs (1)
820var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Transforms\ValueMapping.cs (1)
291HashSet<TValue> valueSet = new HashSet<TValue>();
Transforms\ValueToKeyMappingTransformer.cs (1)
528HashSet<int> toTrain = null;
Microsoft.ML.Ensemble (2)
PipelineEnsemble.cs (2)
35private readonly HashSet<int> _inputColIndices; 413HashSet<string> inputCols = null;
Microsoft.ML.EntryPoints (3)
FeatureCombiner.cs (2)
59var featNames = new HashSet<string>(); 152private static List<KeyToVectorMappingEstimator.ColumnOptions> ConvertFeatures(IEnumerable<DataViewSchema.Column> feats, HashSet<string> featNames, List<KeyValuePair<string, string>> concatNames, IChannel ch,
JsonUtils\JsonManifestUtils.cs (1)
156var collectedFields = new HashSet<string>();
Microsoft.ML.FastTree (5)
FastTree.cs (1)
1397HashSet<int> constructed = new HashSet<int>();
Training\DocumentPartitioning.cs (1)
245public unsafe void Split(int leaf, IntArray bins, HashSet<int> categoricalIndices, int gtChildIndex)
Training\RegressionTreeNodeDocuments.cs (2)
60public HashSet<int> GetDocuments() 62HashSet<int> documentsInNode;
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (1)
45protected HashSet<int> CategoricalThresholds;
Microsoft.ML.IntegrationTests (1)
IntrospectiveTraining.cs (1)
353var uniqueValues = new HashSet<string>();
Microsoft.ML.InternalCodeAnalyzer (1)
ContractsCheckAnalyzer.cs (1)
80private static readonly HashSet<string> _targetSet = new HashSet<string>(new[]
Microsoft.ML.OnnxConverter (14)
OnnxContextImpl.cs (2)
27private readonly HashSet<string> _variableNames; 29private readonly HashSet<string> _nodeNames;
OnnxExportExtensions.cs (1)
26var outputColumnNamesToDrop = new HashSet<string>();
SaveOnnxCommand.cs (11)
86private readonly HashSet<string> _inputsToDrop; 87private readonly HashSet<string> _outputsToDrop; 123private static HashSet<string> CreateDropMap(string[] toDrop) 165LinkedList<ITransformCanSaveOnnx> transforms, HashSet<string> inputColumnNamesToDrop = null, HashSet<string> outputColumnNamesToDrop = null) 169HashSet<string> inputColumns = new HashSet<string>(); 261private HashSet<string> GetPassThroughKeyDataViewTypeColumnsNames(IDataView source, IDataView end) 263var inputKeyDataViewTypeColumnsNames = new HashSet<string>(); 268var passThroughColumnNames = new HashSet<string>(); 269var outputColumnNames = new HashSet<string>(); 390var passThroughColumnNames = GetPassThroughKeyDataViewTypeColumnsNames(source, end);
Microsoft.ML.OnnxTransformer (1)
OnnxUtils.cs (1)
494private static readonly HashSet<Type> _onnxTypeMap =
Microsoft.ML.Predictor.Tests (1)
TestTransposer.cs (1)
108HashSet<int> forceDenseSlotSet = new HashSet<int>(forceDenseSlot);
Microsoft.ML.ResultProcessor (2)
ResultProcessor.cs (2)
45public HashSet<string> SettingHeaderNames; 50public HashSet<string> ResultHeaderNames;
Microsoft.ML.StandardTrainers (1)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
206HashSet<string> labelNamesSet = new HashSet<string>();
Microsoft.ML.Sweeper (5)
Algorithms\Grid.cs (2)
71var result = new HashSet<ParameterSet>(); 159var result = new HashSet<ParameterSet>();
Algorithms\SmacSweeper.cs (2)
199HashSet<Tuple<double, ParameterSet>> configurations = new HashSet<Tuple<double, ParameterSet>>(); 216HashSet<ParameterSet> retainedConfigs = new HashSet<ParameterSet>();
AsyncSweeper.cs (1)
188private readonly HashSet<int> _nullRuns;
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
385var newNames = new HashSet<string>();
Microsoft.ML.TestFramework (3)
BaseTestPredictorsMaml.cs (1)
228HashSet<string> removeArgs = new HashSet<string>();
DataPipe\TestDataPipeBase.cs (2)
473var hs = new HashSet<string>(); 727HashSet<DataViewRowId> idsSeen = null;
Microsoft.ML.Tests (5)
OnnxConversionTest.cs (2)
808var redundantInputColumnNames = new HashSet<string> { "Label" }; 810var redundantOutputColumnNames = new HashSet<string> { "Label", "F1", "F2", "Features" };
Scenarios\ClusteringTests.cs (1)
72var labels = new HashSet<uint>();
Transformers\CustomMappingTests.cs (1)
132public HashSet<float> SeenValues;
Transformers\ValueMappingTests.cs (1)
580var allowedKeyPool = new HashSet<ReadOnlyMemory<char>>(allowedKeys.DenseValues());
Microsoft.ML.TimeSeries (1)
PredictionEngine.cs (1)
169var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Microsoft.ML.Tokenizers (2)
Model\EnglishRobertaTokenizer.cs (2)
971HashSet<(string, string)> pairs = new(); 1061private static void WordToPairs(IReadOnlyList<string> word, HashSet<(string, string)> pairs)
Microsoft.ML.TorchSharp (6)
AutoFormerV2\ObjectDetectionMetrics.cs (1)
85var labelSet = new HashSet<string>();
AutoFormerV2\ObjectDetectionTrainer.cs (2)
247var uniqueLabels = new HashSet<uint>(); 724private readonly HashSet<int> _inputColIndices;
NasBert\TextClassificationTrainer.cs (1)
153var uniqueLabels = new HashSet<uint>();
Roberta\QATrainer.cs (1)
710private readonly HashSet<int> _inputColIndices;
TorchSharpBaseTrainer.cs (1)
445private protected readonly HashSet<int> InputColIndices;
Microsoft.ML.Transforms (5)
Dracula\DictCountTable.cs (1)
233var keys = new HashSet<long>();
LoadTransform.cs (1)
77var allTags = new HashSet<string>();
MutualInformationFeatureSelection.cs (1)
177var colSet = new HashSet<string>();
OptionalColumnTransform.cs (1)
377var activeIndices = new HashSet<int>(activeColumns.Select(c => c.Index));
Text\NgramHashingTransformer.cs (1)
199HashSet<int> columnWithInvertHash = new HashSet<int>();
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
628var newNames = new HashSet<string>();
Microsoft.VisualStudio.LanguageServices (23)
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
38private readonly HashSet<ParameterViewModel> _disabledParameters = [];
CommonControls\MemberSelectionViewModel.cs (2)
172var visited = new HashSet<ISymbol>(); 173var result = new HashSet<ISymbol>();
ErrorReporting\VisualStudioInfoBar.cs (1)
43private readonly HashSet<string> _currentlyShowingMessages = [];
FindReferences\StreamingFindUsagesPresenter.cs (1)
54private readonly HashSet<AbstractTableDataSourceFindUsagesContext> _currentContexts = [];
Interop\CleanableWeakComHandleTable.cs (1)
31private readonly HashSet<TKey> _deadKeySet;
Library\ObjectBrowser\AbstractListItemFactory.cs (3)
336HashSet<ISymbol> overriddenMembers = null; 374private static void AddOverriddenMembers(INamedTypeSymbol namedTypeSymbol, ref HashSet<ISymbol> overriddenMembers) 594HashSet<AssemblyIdentity> assemblyIdentitySet = null;
MoveStaticMembers\StaticMemberSelectionViewModel.cs (2)
88var visited = new HashSet<ISymbol>(); 89var result = new HashSet<ISymbol>();
Packaging\PackageInstallerServiceFactory.cs (1)
521ImmutableSegmentedList<(bool solutionChanged, ProjectId? changedProject)> workQueue, Solution solution, HashSet<ProjectId> projectsToProcess)
Preview\PreviewEngine.cs (1)
161var linkedDocumentIds = new HashSet<DocumentId>();
ProjectSystem\AbstractEntryPointFinder.cs (1)
13protected readonly HashSet<INamedTypeSymbol> EntryPoints = [];
ProjectSystem\FileChangeWatcher.cs (1)
349private readonly HashSet<RegularWatchedFile> _activeFileWatchingTokens = [];
ProjectSystem\RuleSets\RuleSetEventHandler.cs (1)
184var ruleSetDeletions = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
PullMemberUp\SymbolDependentsBuilder.cs (1)
39private readonly HashSet<ISymbol> _dependents = [];
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
250var languageServices = projectDiagnosticsToFixMap.Select(p => p.Key.Services).Concat(documentDiagnosticsToFixMap.Select(kvp => kvp.Key.Project.Services)).ToHashSet(); 551var latestDiagnosticsToFix = filterStaleDiagnostics ? new HashSet<DiagnosticData>() : null;
Venus\ContainedDocument.cs (4)
256SharedPools.Default<HashSet<int>>().ClearAndFree((HashSet<int>)affectedVisibleSpanIndices); 726var affectedSpans = SharedPools.Default<HashSet<int>>().AllocateAndClear();
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
ReferenceCodeLensProvider.cs (1)
50private readonly Dictionary<Guid, (string version, HashSet<DataPoint> dataPoints)> _dataPoints = [];
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
20var seen = new HashSet<string>();
netstandard (1)
netstandard.cs (1)
109[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.HashSet<>))]
PresentationBuildTasks (2)
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (1)
391HashSet<string> localMarkupPages = new HashSet<string>(_mcPass1.PageMarkup.Select(x => x.GetMetadata(SharedStrings.FullPath)), StringComparer.OrdinalIgnoreCase);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
1953private HashSet<string> _names;
PresentationCore (7)
MS\Internal\FontCache\FontResourceCache.cs (1)
27HashSet<string> contentFiles = ContentFileHelper.GetContentFiles(entryAssembly);
MS\Internal\Resources\ContentFileHelper.cs (3)
40internal static HashSet<string> GetContentFiles(Assembly asm) 42HashSet<string> contentFiles = null; 77private static HashSet<string> _contentFiles;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (1)
74private static readonly HashSet<WeakReference<IAppDomainShutdownListener>> _listeners;
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1890HashSet<AutomationPeer> hs = null;
System\Windows\Media\MediaContext.cs (1)
2684private HashSet<ICompositionTarget> _registeredICompositionTargets;
PresentationFramework (7)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (1)
16private static readonly HashSet<string> ProjectedRuntimeClassNames = new HashSet<string>();
System\Windows\Markup\RestrictiveXamlXmlReader.cs (5)
21private static readonly HashSet<string> AllXamlNamespaces = new HashSet<string>(XamlLanguage.XamlNamespaces); 23private static readonly HashSet<string> SafeTypesFromRegistry = ReadAllowedTypesForRestrictedXamlContexts(); 25private static HashSet<string> ReadAllowedTypesForRestrictedXamlContexts() 27HashSet<string> allowedTypesFromRegistry = new HashSet<string>(); 213private HashSet<Type> _safeTypesSet = new HashSet<Type>() {
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
27private HashSet<string> _clrNamespaces;
Replay (2)
Replay.cs (2)
149var outputSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 223var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Roslyn.Diagnostics.Analyzers (75)
AbstractDoNotCopyValue.cs (4)
188private static VisitReleaser<T> TryAddForVisit<T>(HashSet<T> set, T? value, out bool added) 208private readonly HashSet<T> _set; 211public VisitReleaser(HashSet<T> set, T value) 362private readonly HashSet<IOperation> _handledOperations = [];
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
Roslyn.Diagnostics.CSharp.Analyzers (7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
164var result = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
30var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (2)
45HashSet<INamespaceSymbol> conflicts, 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
45var unnecessaryImports = await GetCommonUnnecessaryImportsOfAllContextAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
52var symbolsInBlock = semanticModel.GetAllDeclaredSymbols(container, cancellationToken,
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\TelemetryPanel.xaml.cs (1)
60var seenType = new HashSet<Type>();
Roslyn.VisualStudio.Next.UnitTests (3)
Options\VisualStudioOptionStorageTests.cs (1)
291var set = new HashSet<string>();
Remote\SerializationValidator.cs (1)
28public override async Task GetAssetsAsync<T, TArg>(AssetPath assetPath, HashSet<Checksum> checksums, Action<Checksum, T, TArg>? callback, TArg? arg, CancellationToken cancellationToken) where TArg : default
Services\ServiceHubServicesTests.cs (1)
1854var expectedSet = new HashSet<T>(expected);
RulesetToEditorconfigConverter (2)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
RunTests (2)
AssemblyScheduler.cs (2)
103var unmatchedLocalTests = new HashSet<string>(); 106var matchedRemoteTests = new HashSet<string>();
Shared (5)
Pools\PooledSetPolicy.cs (3)
14internal sealed class PooledSetPolicy<T> : PooledObjectPolicy<HashSet<T>> 24public override HashSet<T> Create() => new(_comparer); 26public override bool Return(HashSet<T> obj)
Pools\PoolFactory.cs (2)
161/// Creates an object pool of <see cref="HashSet{T}"/> instances. 171public static ObjectPool<HashSet<T>> CreateHashSetPool<T>(IEqualityComparer<T>? comparer = null, int maxCapacity = DefaultCapacity)
Shared.Tests (7)
JsonSchemaExporter\TestTypes.cs (2)
804yield return new TestData<HashSet<string>>(["one", "two", "three"], """{"type":["array","null"],"items":{"type":["string","null"]}}"""); 1286[JsonSerializable(typeof(HashSet<string>))]
Pools\PoolTests.cs (5)
61var set = new HashSet<Foo>(); 181var s = pool.Get(); 185var s2 = pool.Get(); 251var uniques = new HashSet<Foo>(); 268var objects = new HashSet<Foo>();
SocialWeather (4)
PersistentConnectionLifeTimeManager.cs (4)
71var groups = (HashSet<string>)connection.Items["groups"]; 80var groups = (HashSet<string>)connection.Items["groups"];
System.CodeDom (1)
src\libraries\Common\src\System\CSharpHelpers.cs (1)
14private static readonly HashSet<string> s_fixedStringLookup = new HashSet<string>()
System.Collections (1)
artifacts\obj\System.Collections\Debug\net10.0\System.Collections.Forwards.cs (1)
8[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.HashSet<>))]
System.Collections.Immutable (23)
System\Collections\Frozen\DefaultFrozenSet.cs (1)
12internal DefaultFrozenSet(HashSet<T> source)
System\Collections\Frozen\FrozenHashTable.cs (1)
157HashSet<int>? codes = null;
System\Collections\Frozen\FrozenSet.cs (9)
38HashSet<T> set = 58GetExistingFrozenOrNewSet(source, comparer, out HashSet<T>? newSet) ?? 61/// <summary>Extracts from the source either an existing <see cref="FrozenSet{T}"/> instance or a <see cref="HashSet{T}"/> containing the values and the specified <paramref name="comparer"/>.</summary> 62private static FrozenSet<T>? GetExistingFrozenOrNewSet<T>(IEnumerable<T> source, IEqualityComparer<T>? comparer, out HashSet<T>? newSet) 76newSet = source as HashSet<T>; 95private static FrozenSet<T> CreateFromSet<T>(HashSet<T> source) 124return (FrozenSet<T>)(object)new Int32FrozenSet((HashSet<int>)(object)source); 141HashSet<string> stringValues = (HashSet<string>)(object)source;
System\Collections\Frozen\FrozenSetInternalBase.cs (1)
163HashSet<T> hs => _thisSet.Comparer.Equals(hs.Comparer),
System\Collections\Frozen\Int32\Int32FrozenSet.cs (1)
19internal Int32FrozenSet(HashSet<int> source) : base(EqualityComparer<int>.Default)
System\Collections\Frozen\ItemsFrozenSet.cs (1)
17protected ItemsFrozenSet(HashSet<T> source, bool keysAreHashCodes = false) : base(source.Comparer)
System\Collections\Frozen\SmallFrozenSet.cs (1)
19internal SmallFrozenSet(HashSet<T> source) : base(source.Comparer)
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (1)
23internal SmallValueTypeComparableFrozenSet(HashSet<T> source) : base(EqualityComparer<T>.Default)
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (1)
16internal SmallValueTypeDefaultComparerFrozenSet(HashSet<T> source) : base(EqualityComparer<T>.Default)
System\Collections\Frozen\String\KeyAnalyzer.cs (2)
66HashSet<string> set = new HashSet<string>( 263internal static bool HasSufficientUniquenessFactor(HashSet<string> set, ReadOnlySpan<string> uniqueStrings, int acceptableNonUniqueCount)
System\Collections\Frozen\ValueTypeDefaultComparerFrozenSet.cs (1)
13internal ValueTypeDefaultComparerFrozenSet(HashSet<T> source) : base(source, Constants.KeysAreHashCodes<T>())
System\Collections\Immutable\ImmutableHashSet_1.cs (3)
746var otherSet = new HashSet<T>(other, origin.EqualityComparer); 883var otherSet = new HashSet<T>(other, origin.EqualityComparer); 956var otherSet = new HashSet<T>(other, origin.EqualityComparer);
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (2)
149HashSet<string> mainTypeMemberNames = new HashSet<string>(mainType.GetProperties().Select(p => p.Name)); 154HashSet<string> buddyTypeMembers = new HashSet<string>(buddyFields.Concat(buddyProperties), StringComparer.Ordinal);
System.ComponentModel.Composition (14)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (1)
25private HashSet<string>? _contractNamesOnNonInterfaces;
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogChangeProxy.cs (1)
17private readonly HashSet<ComposablePartDefinition> _removedParts;
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (7)
40private readonly HashSet<ComposablePartDefinition> _rejectedParts = new HashSet<ComposablePartDefinition>(); 42private readonly HashSet<IDisposable> _partsToDispose = new HashSet<IDisposable>(); 221HashSet<IDisposable>? partsToDispose = null; 783var affectedRejections = new HashSet<ComposablePartDefinition>(); 932HashSet<ComposablePartDefinition> hashset, 1001private readonly HashSet<ComposablePartDefinition> _parts; 1002public PartInHashSetQueryStateNode(HashSet<ComposablePartDefinition> parts, PartQueryStateNode? previousNode, AtomicCompositionQueryState state) :
System\ComponentModel\Composition\Hosting\FilteredCatalog.Traversal.cs (4)
71var traversalClosure = GetTraversalClosure(_innerCatalog.Where(_filter), traversal); 80private static HashSet<ComposablePartDefinition> GetTraversalClosure(IEnumerable<ComposablePartDefinition> parts, IComposablePartCatalogTraversal traversal) 84var traversedParts = new HashSet<ComposablePartDefinition>(); 89private static void GetTraversalClosure(IEnumerable<ComposablePartDefinition> parts, HashSet<ComposablePartDefinition> traversedParts, IComposablePartCatalogTraversal traversal)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (1)
157HashSet<ComposablePartDefinition>? candidates = null;
System.ComponentModel.TypeConverter (2)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (1)
117var filter = new HashSet<object>(attributes.Count);
System\Drawing\ColorConverter.cs (1)
20var set = new HashSet<Color>(ColorTable.Colors.Values);
System.Composition.Hosting (3)
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (3)
39var @checked = new HashSet<ExportDescriptorPromise>(); 54private void CheckTarget(CompositionDependency dependency, HashSet<ExportDescriptorPromise> @checked, Stack<CompositionDependency> checking) 79private void CheckDependency(CompositionDependency dependency, HashSet<ExportDescriptorPromise> @checked, Stack<CompositionDependency> checking)
System.Core (1)
System.Core.cs (1)
23[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.HashSet<>))]
System.Data.Common (2)
System\Data\TypeLimiter.cs (2)
130private static readonly HashSet<Type> s_allowedTypes = new HashSet<Type>() 186private readonly HashSet<Type> m_allowedTypes;
System.Diagnostics.DiagnosticSource (3)
System\Diagnostics\DsesActivitySourceListener.cs (2)
15private HashSet<string>? _listenToActivitySourceNames; 74var allSources = _listenToActivitySourceNames ??= new(StringComparer.OrdinalIgnoreCase);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
341private HashSet<string> _sharedSessionClientIds = new HashSet<string>();
System.Formats.Cbor (17)
System\Formats\Cbor\Reader\CborReader.cs (3)
25private HashSet<(int Offset, int Length)>? _keyEncodingRanges; // all key encoding ranges up to encoding equality 298HashSet<(int Offset, int Length)>? keyEncodingRanges) 317public HashSet<(int Offset, int Length)>? KeyEncodingRanges { get; }
System\Formats\Cbor\Reader\CborReader.Map.cs (6)
12private Stack<HashSet<(int Offset, int Length)>>? _pooledKeyEncodingRangeAllocations; 162HashSet<(int Offset, int Length)> keyEncodingRanges = GetKeyEncodingRanges(); 171private HashSet<(int Offset, int Length)> GetKeyEncodingRanges() 179_pooledKeyEncodingRangeAllocations.TryPop(out HashSet<(int Offset, int Length)>? result)) 189private void ReturnKeyEncodingRangeAllocation(HashSet<(int Offset, int Length)>? allocation) 193_pooledKeyEncodingRangeAllocations ??= new Stack<HashSet<(int Offset, int Length)>>();
System\Formats\Cbor\Writer\CborWriter.cs (3)
33private HashSet<(int Offset, int Length)>? _keyEncodingRanges; // all key encoding ranges up to encoding equality 432HashSet<(int Offset, int Length)>? keyEncodingRanges) 454public HashSet<(int Offset, int Length)>? KeyEncodingRanges { get; }
System\Formats\Cbor\Writer\CborWriter.Map.cs (5)
14private Stack<HashSet<(int Offset, int Length)>>? _pooledKeyEncodingRangeSets; 99HashSet<(int Offset, int Length)> keyEncodingRanges = GetKeyEncodingRanges(); 184private HashSet<(int Offset, int Length)> GetKeyEncodingRanges() 192_pooledKeyEncodingRangeSets.TryPop(out HashSet<(int Offset, int Length)>? result)) 207_pooledKeyEncodingRangeSets ??= new Stack<HashSet<(int Offset, int Length)>>();
System.IO.Packaging (2)
System\IO\Packaging\XmlCompatibilityReader.cs (2)
1730private HashSet<string>? _names; 1781private HashSet<string>? _names;
System.Linq (14)
System\Linq\Distinct.cs (2)
78var set = new HashSet<TKey>(DefaultInternalSetCapacity, comparer); 99private HashSet<TSource>? _set;
System\Linq\Except.cs (2)
81var set = new HashSet<TSource>(second, comparer); 94var set = new HashSet<TKey>(second, comparer);
System\Linq\Intersect.cs (2)
78var set = new HashSet<TSource>(second, comparer); 91var set = new HashSet<TKey>(second, comparer);
System\Linq\ToCollection.cs (2)
247public static HashSet<TSource> ToHashSet<TSource>(this IEnumerable<TSource> source) => source.ToHashSet(comparer: null); 249public static HashSet<TSource> ToHashSet<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource>? comparer)
System\Linq\Union.cs (4)
78var set = new HashSet<TKey>(DefaultInternalSetCapacity, comparer); 105private HashSet<TSource>? _set; 139var set = new HashSet<TSource>(DefaultInternalSetCapacity, _comparer); 151HashSet<TSource> set = _set;
System\Linq\Union.SpeedOpt.cs (2)
12private HashSet<TSource> FillSet() 14var set = new HashSet<TSource>(_comparer);
System.Linq.AsyncEnumerable (18)
System\Linq\Distinct.cs (1)
37HashSet<TSource> set = new(comparer);
System\Linq\DistinctBy.cs (2)
49HashSet<TKey> set = new(comparer); 99HashSet<TKey> set = new(comparer);
System\Linq\Except.cs (1)
46HashSet<TSource> set = new(comparer);
System\Linq\ExceptBy.cs (2)
54HashSet<TKey> set = new(comparer); 114HashSet<TKey> set = new(comparer);
System\Linq\Intersect.cs (1)
39HashSet<TSource> set;
System\Linq\IntersectBy.cs (2)
52HashSet<TKey> set; 117HashSet<TKey> set;
System\Linq\ToHashSetAsync.cs (6)
13/// <summary>Creates a <see cref="HashSet{T}"/> from an <see cref="IAsyncEnumerable{T}"/>.</summary> 15/// <param name="source">An <see cref="IEnumerable{T}"/> to create a <see cref="HashSet{T}"/> from.</param> 18/// <returns>A <see cref="HashSet{T}"/> that contains values of type <typeparamref name="TSource"/> selected from the input sequence.</returns> 20public static ValueTask<HashSet<TSource>> ToHashSetAsync<TSource>( 29static async ValueTask<HashSet<TSource>> Impl( 33HashSet<TSource> set = new(comparer);
System\Linq\Union.cs (1)
39HashSet<TSource> set = new(comparer);
System\Linq\UnionBy.cs (2)
44HashSet<TKey> set = new(comparer); 95HashSet<TKey> set = new(comparer);
System.Linq.Expressions (22)
System\Dynamic\BindingRestrictions.cs (1)
145private readonly HashSet<BindingRestrictions> _unique = new HashSet<BindingRestrictions>();
System\Dynamic\Utils\Helpers.cs (1)
19var set = new HashSet<T>(cmp);
System\Linq\Expressions\BlockExpression.cs (1)
1071var set = new HashSet<ParameterExpression>();
System\Linq\Expressions\Compiler\CompilerScope.cs (1)
77internal HashSet<BlockExpression>? MergedScopes;
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
38private readonly HashSet<LabelScopeInfo> _definitions = new HashSet<LabelScopeInfo>();
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
395var uniqueKeys = new HashSet<decimal>();
System\Linq\Expressions\Interpreter\LabelInfo.cs (6)
178if (_definitions is HashSet<LabelScopeInfo> definitions) 193foreach (var x in (HashSet<LabelScopeInfo>)_definitions!) 208HashSet<LabelScopeInfo>? set = _definitions as HashSet<LabelScopeInfo>; 217private bool HasMultipleDefinitions => _definitions is HashSet<LabelScopeInfo>; 226var set = new HashSet<T>(cmp);
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
2789public readonly HashSet<ParameterExpression> _hoistedParameters = new HashSet<ParameterExpression>();
System\Linq\Expressions\Interpreter\TypeOperations.cs (3)
505private readonly Stack<HashSet<ParameterExpression>> _shadowedVars = new Stack<HashSet<ParameterExpression>>(); 517var parameters = new HashSet<ParameterExpression>();
System\Linq\Expressions\LambdaExpression.cs (2)
862var set = new HashSet<ParameterExpression>(); 944var set = new HashSet<ParameterExpression>();
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (4)
60private readonly Stack<HashSet<ParameterExpression>> _shadowedVars = new Stack<HashSet<ParameterExpression>>(); 72var parameters = new HashSet<ParameterExpression>(); 186foreach (HashSet<ParameterExpression> hidden in _shadowedVars)
System.Linq.Parallel (5)
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (2)
142private HashSet<TInputOutput>? _hashLookup; // The hash lookup, used to produce the distinct set. 270HashSet<TInputOutput> rightLookup = new HashSet<TInputOutput>(_comparer);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
131private HashSet<TInputOutput>? _hashLookup; // The hash lookup, used to produce the intersection.
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
187private HashSet<TInputOutput>? _hashLookup; // The hash lookup, used to produce the union.
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
122private readonly HashSet<TInputOutput> _hashLookup; // The hash lookup, used to produce the distinct set.
System.Net.HttpListener (1)
System\Net\Managed\HttpEndPointListener.cs (1)
45private readonly HashSet<HttpConnection> _unregisteredConnections;
System.Private.CoreLib (107)
src\libraries\System.Private.CoreLib\src\Internal\Runtime\InteropServices\ComponentActivator.cs (1)
26private static readonly HashSet<string> s_loadedInDefaultContext = new HashSet<string>(StringComparer.InvariantCulture);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (68)
95if (collection is HashSet<T> otherAsHashSet && EffectiveEqualityComparersAreEqual(this, otherAsHashSet)) 146private void ConstructFrom(HashSet<T> source) 196/// <summary>Removes all elements from the <see cref="HashSet{T}"/> object.</summary> 213/// <summary>Determines whether the <see cref="HashSet{T}"/> contains the specified element.</summary> 214/// <param name="item">The element to locate in the <see cref="HashSet{T}"/> object.</param> 215/// <returns>true if the <see cref="HashSet{T}"/> object contains the specified element; otherwise, false.</returns> 371/// Gets an instance of a type that may be used to perform operations on the current <see cref="HashSet{T}"/> 393/// Gets an instance of a type that may be used to perform operations on the current <see cref="HashSet{T}"/> 417/// Provides a type that may be used to perform operations on a <see cref="HashSet{T}"/> 424internal AlternateLookup(HashSet<T> set) 431/// <summary>Gets the <see cref="HashSet{T}"/> against which this instance performs operations.</summary> 432public HashSet<T> Set { get; } 436internal static bool IsCompatibleItem(HashSet<T> set) 444internal static IAlternateEqualityComparer<TAlternate, T> GetAlternateComparer(HashSet<T> set) 455HashSet<T> set = Set; 543HashSet<T> set = Set; 628HashSet<T> set = Set; 769/// <summary>Adds the specified element to the <see cref="HashSet{T}"/>.</summary> 771/// <returns>true if the element is added to the <see cref="HashSet{T}"/> object; false if the element is already present.</returns> 800/// <summary>Modifies the current <see cref="HashSet{T}"/> object to contain all elements that are present in itself, the specified collection, or both.</summary> 801/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 815/// <summary>Modifies the current <see cref="HashSet{T}"/> object to contain only elements that are present in that object and in the specified collection.</summary> 816/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 842if (other is HashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 852/// <summary>Removes all elements in the specified collection from the current <see cref="HashSet{T}"/> object.</summary> 853/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 881/// <summary>Modifies the current <see cref="HashSet{T}"/> object to contain only elements that are present either in that object or in the specified collection, but not both.</summary> 882/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 909if (other is HashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 919/// <summary>Determines whether a <see cref="HashSet{T}"/> object is a subset of the specified collection.</summary> 920/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 921/// <returns>true if the <see cref="HashSet{T}"/> object is a subset of <paramref name="other"/>; otherwise, false.</returns> 946if (other is HashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 956/// <summary>Determines whether a <see cref="HashSet{T}"/> object is a proper subset of the specified collection.</summary> 957/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 958/// <returns>true if the <see cref="HashSet{T}"/> object is a proper subset of <paramref name="other"/>; otherwise, false.</returns> 988if (other is HashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 1000/// <summary>Determines whether a <see cref="HashSet{T}"/> object is a proper superset of the specified collection.</summary> 1001/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 1002/// <returns>true if the <see cref="HashSet{T}"/> object is a superset of <paramref name="other"/>; otherwise, false.</returns> 1026if (other is HashSet<T> otherAsSet && 1045/// <summary>Determines whether a <see cref="HashSet{T}"/> object is a proper superset of the specified collection.</summary> 1046/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 1047/// <returns>true if the <see cref="HashSet{T}"/> object is a proper superset of <paramref name="other"/>; otherwise, false.</returns> 1071if (other is HashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 1088/// <summary>Determines whether the current <see cref="HashSet{T}"/> object and a specified collection share common elements.</summary> 1089/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 1090/// <returns>true if the <see cref="HashSet{T}"/> object and <paramref name="other"/> share at least one common element; otherwise, false.</returns> 1120/// <summary>Determines whether a <see cref="HashSet{T}"/> object and the specified collection contain the same elements.</summary> 1121/// <param name="other">The collection to compare to the current <see cref="HashSet{T}"/> object.</param> 1122/// <returns>true if the <see cref="HashSet{T}"/> object is equal to <paramref name="other"/>; otherwise, false.</returns> 1145if (other is HashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 1172/// <summary>Copies the elements of a <see cref="HashSet{T}"/> object to an array, starting at the specified array index.</summary> 1207/// <summary>Removes all elements that match the conditions defined by the specified predicate from a <see cref="HashSet{T}"/> collection.</summary> 1333/// Sets the capacity of a <see cref="HashSet{T}"/> object to the actual number of elements it contains, 1339/// Sets the capacity of a <see cref="HashSet{T}"/> object to the specified number of entries, 1383/// <summary>Returns an <see cref="IEqualityComparer"/> object that can be used for equality testing of a <see cref="HashSet{T}"/> object.</summary> 1384public static IEqualityComparer<HashSet<T>> CreateSetComparer() => new HashSetEqualityComparer<T>(); 1410/// <returns>true if the element is added to the <see cref="HashSet{T}"/> object; false if the element is already present.</returns> 1533internal bool IsSubsetOfHashSetWithSameComparer(HashSet<T> other) 1550private void IntersectWithHashSetWithSameComparer(HashSet<T> other) 1617private void SymmetricExceptWithUniqueHashSet(HashSet<T> other) 1776internal static bool EqualityComparersAreEqual(HashSet<T> set1, HashSet<T> set2) => set1.Comparer.Equals(set2.Comparer); 1782internal static bool EffectiveEqualityComparersAreEqual(HashSet<T> set1, HashSet<T> set2) => set1.EffectiveComparer.Equals(set2.EffectiveComparer); 1800private readonly HashSet<T> _hashSet; 1805internal Enumerator(HashSet<T> hashSet)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSetEqualityComparer.cs (5)
9internal sealed class HashSetEqualityComparer<T> : IEqualityComparer<HashSet<T>?> 11public bool Equals(HashSet<T>? x, HashSet<T>? y) 29if (HashSet<T>.EqualityComparersAreEqual(x, y)) 56public int GetHashCode(HashSet<T>? obj)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\InsertionBehavior.cs (1)
7/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
265HashSet<T> hashSet = [];
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (2)
67var unique = new HashSet<char>(_hashEntries); 194HashSet<char> unique = [.. values];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (2)
119protected AsciiStringSearchValuesTeddyBase(ReadOnlySpan<string> values, HashSet<string> uniqueValues, int n) : base(values, uniqueValues) 135protected AsciiStringSearchValuesTeddyBase(string[][] buckets, ReadOnlySpan<string> values, HashSet<string> uniqueValues, int n) : base(values, uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBucketizedN2.cs (1)
15public AsciiStringSearchValuesTeddyBucketizedN2(string[][] buckets, ReadOnlySpan<string> values, HashSet<string> uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBucketizedN3.cs (1)
15public AsciiStringSearchValuesTeddyBucketizedN3(string[][] buckets, ReadOnlySpan<string> values, HashSet<string> uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyNonBucketizedN2.cs (1)
15public AsciiStringSearchValuesTeddyNonBucketizedN2(ReadOnlySpan<string> values, HashSet<string> uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyNonBucketizedN3.cs (1)
15public AsciiStringSearchValuesTeddyNonBucketizedN3(ReadOnlySpan<string> values, HashSet<string> uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (2)
22public AhoCorasickBuilder(ReadOnlySpan<string> values, bool ignoreCase, ref HashSet<string>? unreachableValues) 65private void BuildTrie(ref HashSet<string>? unreachableValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\MultiStringIgnoreCaseSearchValuesFallback.cs (1)
12public MultiStringIgnoreCaseSearchValuesFallback(HashSet<string> uniqueValues) : base(uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesFallback.cs (1)
15public SingleStringSearchValuesFallback(string value, HashSet<string> uniqueValues) : base(uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (1)
46public SingleStringSearchValuesThreeChars(HashSet<string>? uniqueValues, string value) : base(uniqueValues)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (9)
44var uniqueValues = new HashSet<string>(values.Length, ignoreCase ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal); 71HashSet<string>? unreachableValues = null; 98static Span<string> RemoveUnreachableValues(Span<string> values, HashSet<string> unreachableValues) 118HashSet<string> uniqueValues, 163static SearchValues<string> PickAhoCorasickImplementation<TCaseSensitivity>(AhoCorasick ahoCorasick, HashSet<string> uniqueValues) 174HashSet<string> uniqueValues, 287HashSet<string> uniqueValues, 379HashSet<string>? uniqueValues, 412HashSet<string>? uniqueValues,
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesAhoCorasick.cs (1)
15public StringSearchValuesAhoCorasick(AhoCorasick ahoCorasick, HashSet<string> uniqueValues) : base(uniqueValues) =>
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesBase.cs (2)
18private readonly HashSet<string>? _uniqueValues; 25public StringSearchValuesBase(HashSet<string>? uniqueValues) =>
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesRabinKarp.cs (1)
14public StringSearchValuesRabinKarp(ReadOnlySpan<string> values, HashSet<string> uniqueValues) : base(uniqueValues) =>
src\libraries\System.Private.CoreLib\src\System\StringComparer.cs (1)
72/// when passed to <see cref="Dictionary{String, TValue}.Dictionary"/> or <see cref="HashSet{String}.HashSet"/>.
src\System\Reflection\RuntimeCustomAttributeData.cs (3)
1932private static readonly HashSet<RuntimeType> s_pca = CreatePseudoCustomAttributeHashSet(); 1936private static HashSet<RuntimeType> CreatePseudoCustomAttributeHashSet() 1954HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length);
src\System\RuntimeType.CoreCLR.cs (1)
1029var al = new HashSet<RuntimeType>();
System.Private.CoreLib.Generators (18)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (7)
120public IntrinsicsAnalyzerOnLoadData(HashSet<INamedTypeSymbol> namedTypesToBeProtected, 128public readonly HashSet<INamedTypeSymbol> NamedTypesToBeProtected; 139HashSet<INamedTypeSymbol> namedTypesToBeProtected = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 399HashSet<INamedTypeSymbol> examinedSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 427HashSet<INamedTypeSymbol> examinedSymbols = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 568HashSet<INamedTypeSymbol> notTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default); 606HashSet<ISymbol> foundSymbols = new HashSet<ISymbol>(SymbolEqualityComparer.Default);
NativeRuntimeEventSourceGenerator.cs (11)
40Dictionary<string, HashSet<string>> inclusionList = ParseInclusionListFromString(inclusionText); 61private static Dictionary<string, HashSet<string>> ParseInclusionListFromString(string? inclusionText) 63Dictionary<string, HashSet<string>> inclusionList = []; 101if (!inclusionList.TryGetValue(providerName, out HashSet<string>? value)) 112private static bool IncludeEvent(Dictionary<string, HashSet<string>> inclusionList, string providerName, string eventName) 119if (inclusionList.TryGetValue(providerName, out HashSet<string>? events) && events.Contains(eventName)) 124if (inclusionList.TryGetValue("*", out HashSet<string>? wildcardEvents) && wildcardEvents.Contains(eventName)) 132private static string GenerateEventSourceClass(XElement providerNode, string className, Dictionary<string, HashSet<string>> inclusionList) 159private static void GenerateKeywordsClass(XElement providerNode, StringWriter writer, Dictionary<string, HashSet<string>> inclusionList) 175var usedKeywords = new HashSet<string>(); 222private static void GenerateEventMethods(XElement providerNode, StringWriter writer, Dictionary<string, HashSet<string>> inclusionList)
System.Private.DataContractSerialization (14)
System\Runtime\Serialization\ClassDataContract.cs (1)
1385internal override bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts)
System\Runtime\Serialization\CollectionDataContract.cs (1)
1536internal override bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts)
System\Runtime\Serialization\DataContract.cs (8)
1094private static bool IsTypeSerializable(Type type, HashSet<Type>? previousCollectionTypes) 1123private static void ValidatePreviousCollectionTypes(Type collectionType, Type itemType, HashSet<Type> previousCollectionTypes) 1234internal static XmlQualifiedName GetXmlName(Type type, HashSet<Type> previousCollectionTypes, out bool hasDataContract) 1290private static XmlQualifiedName GetNonDCTypeXmlName(Type type, HashSet<Type> previousCollectionTypes) 1315private static bool TryGetBuiltInXmlAndArrayTypeXmlName(Type type, HashSet<Type> previousCollectionTypes, [NotNullWhen(true)] out XmlQualifiedName? xmlName) 1364internal static XmlQualifiedName GetCollectionXmlName(Type type, Type itemType, HashSet<Type> previousCollectionTypes, out CollectionDataContractAttribute? collectionContractAttribute) 2075internal virtual bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts) 2084internal bool IsEqualOrChecked(object? other, HashSet<DataContractPairKey>? checkedContracts)
System\Runtime\Serialization\DataMember.cs (1)
307internal bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts)
System\Runtime\Serialization\EnumDataContract.cs (1)
413internal override bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts)
System\Runtime\Serialization\PrimitiveDataContract.cs (1)
124internal override bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts)
System\Runtime\Serialization\XmlDataContract.cs (1)
385internal override bool Equals(object? other, HashSet<DataContractPairKey>? checkedContracts)
System.Private.Windows.Core (12)
System\Private\Windows\BinaryFormat\Deserializer\Deserializer.cs (9)
75private HashSet<SerializationRecordId>? _pendingSerializationInfoIds; 80private readonly HashSet<SerializationRecordId> _incompleteObjects = []; 81public HashSet<SerializationRecordId> IncompleteObjects => _incompleteObjects; 84private Dictionary<SerializationRecordId, HashSet<SerializationRecordId>>? _incompleteDependencies; 87private HashSet<ValueUpdater>? _pendingUpdates; 142&& _incompleteDependencies.TryGetValue(pending.ObjectId, out HashSet<SerializationRecordId>? dependencies)) 289if (_incompleteDependencies.TryGetValue(updater.ObjectId, out HashSet<SerializationRecordId>? dependencies)) 360foreach (KeyValuePair<SerializationRecordId, HashSet<SerializationRecordId>> pair in _incompleteDependencies) 363HashSet<SerializationRecordId> dependencies = pair.Value;
System\Private\Windows\BinaryFormat\Deserializer\IDeserializer.cs (1)
33HashSet<SerializationRecordId> IncompleteObjects { get; }
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
558HashSet<string> distinctFormats = [];
System\Private\Windows\Ole\DataStore.cs (1)
153HashSet<string> distinctFormats = new(definedCount);
System.Private.Windows.Core.TestUtilities (1)
BinarySerialization.cs (1)
19public static void EnsureSerializableAttribute(Assembly assemblyUnderTest, HashSet<string> serializableTypes)
System.Private.Xml (11)
src\libraries\Common\src\System\CSharpHelpers.cs (1)
14private static readonly HashSet<string> s_fixedStringLookup = new HashSet<string>()
System\Xml\Core\XmlTextReaderImpl.cs (1)
263private HashSet<IDtdEntityInfo>? _currentEntities;
System\Xml\Dom\XmlLoader.cs (1)
688HashSet<string> prefixes = new HashSet<string>();
System\Xml\Serialization\XmlSerializationILGen.cs (3)
33private readonly HashSet<TypeMapping> _generatedMethods = new HashSet<TypeMapping>(); 60internal HashSet<TypeMapping> GeneratedMethods { get { return _generatedMethods; } } 239var uniqueTypes = new HashSet<Type>();
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
1077var cases = new HashSet<string>();
System\Xml\Serialization\XmlSerializationWriter.cs (3)
30private HashSet<int>? _usedPrefixes; 564private static HashSet<int>? ListUsedPrefixes(XmlSerializerNamespaces nsList, string prefix) 566var qnIndexes = new HashSet<int>();
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
618var values = new HashSet<long>();
System.Private.Xml.Linq (1)
System\Xml\Schema\XNodeValidator.cs (1)
25private HashSet<XmlSchemaInfo>? schemaInfos;
System.Reflection.DispatchProxy (1)
System\Reflection\DispatchProxyGenerator.cs (1)
115private readonly HashSet<string> _ignoresAccessAssemblyNames = new HashSet<string>();
System.Reflection.Emit (2)
System\Reflection\Emit\EventBuilderImpl.cs (1)
20internal HashSet<MethodBuilder>? _otherMethods;
System\Reflection\Emit\PropertyBuilderImpl.cs (1)
20internal HashSet<MethodInfo>? _otherMethods;
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Types\RoType.cs (1)
213HashSet<RoType> ifcs = new HashSet<RoType>();
System.Resources.Extensions (10)
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (9)
78private HashSet<SerializationRecordId>? _pendingSerializationInfoIds; 83private readonly HashSet<SerializationRecordId> _incompleteObjects = []; 84public HashSet<SerializationRecordId> IncompleteObjects => _incompleteObjects; 87private Dictionary<SerializationRecordId, HashSet<SerializationRecordId>>? _incompleteDependencies; 90private HashSet<ValueUpdater>? _pendingUpdates; 147&& _incompleteDependencies.TryGetValue(pending.ObjectId, out HashSet<SerializationRecordId>? dependencies)) 294if (_incompleteDependencies.TryGetValue(updater.ObjectId, out HashSet<SerializationRecordId>? dependencies)) 365foreach (KeyValuePair<SerializationRecordId, HashSet<SerializationRecordId>> pair in _incompleteDependencies) 368HashSet<SerializationRecordId> dependencies = pair.Value;
System\Resources\Extensions\BinaryFormat\Deserializer\IDeserializer.cs (1)
34HashSet<SerializationRecordId> IncompleteObjects { get; }
System.Runtime.Serialization.Schema (5)
System\Runtime\Serialization\Schema\CodeExporter.cs (2)
1401HashSet<string> baseMemberNames = baseContractCodeDomInfo.GetMemberNames(); 1402HashSet<string> memberNames = contractCodeDomInfo.GetMemberNames();
System\Runtime\Serialization\Schema\ContractCodeDomInfo.cs (3)
21private HashSet<string>? _memberNames; 47internal HashSet<string> GetMemberNames() 57HashSet<string> names = GetMemberNames();
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\SignedCms.cs (1)
563var certs = new HashSet<X509Certificate2>(Certificates.OfType<X509Certificate2>());
System.ServiceModel.Syndication (1)
System\ServiceModel\Syndication\SyndicationFeed.cs (1)
15private static readonly HashSet<string> s_acceptedDays = new HashSet<string>(
System.Text.Json (3)
System\Text\Json\Document\JsonDocument.PropertyNameSet.cs (1)
22private HashSet<ReadOnlyMemory<byte>>? _hashSet;
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
40if (jsonTypeInfo.CreateObject is null && Type.IsAssignableFrom(typeof(HashSet<TElement>)))
System\Text\Json\Serialization\Metadata\PropertyRefCacheBuilder.cs (1)
16private readonly HashSet<PropertyRef> _added = [];
System.Text.Json.SourceGeneration (6)
Helpers\KnownTypeSymbols.cs (1)
23public HashSet<ITypeSymbol>? BuiltInSupportTypes { get; set; }
JsonSourceGenerator.Parser.cs (5)
42private readonly HashSet<(string ContextName, string TypeName)> _generatedContextAndTypeNames = new(); 44private readonly HashSet<ITypeSymbol> _builtInSupportTypes; 1511HashSet<string>? memberInitializerNames = null; 1819private static HashSet<ITypeSymbol> CreateBuiltInSupportTypeSet(KnownTypeSymbols knownSymbols) 1822HashSet<ITypeSymbol> builtInSupportTypes = new(SymbolEqualityComparer.Default);
System.Text.RegularExpressions (18)
System\Text\RegularExpressions\RegexCharClass.cs (1)
334var whitespaceSet = new HashSet<char>(s_whitespaceChars);
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (4)
158internal readonly HashSet<RegexNode> _isAtomicByAncestor = new(); // since the root is implicitly atomic, every tree will contain atomic-by-ancestor nodes 160internal readonly HashSet<RegexNode> _containsCapture = new(); // the root is a capture, so this will always contain at least the root node 162internal HashSet<RegexNode>? _mayBacktrack; 164internal HashSet<RegexNode>? _inLoops;
System\Text\RegularExpressions\Symbolic\BDD.cs (2)
251var visited = new HashSet<BDD>(); 458var visited = new HashSet<BDD>();
System\Text\RegularExpressions\Symbolic\MintermGenerator.cs (1)
28public static List<TSet> GenerateMinterms(ISolver<TSet> solver, HashSet<TSet> sets)
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
161HashSet<SymbolicRegexNode<TSet>> seenElems = new();
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Explore.cs (4)
19HashSet<MatchingState<TSet>> seen = new(); 71static (int nfaId, (SymbolicRegexMatcher<TSet> Matcher, HashSet<MatchingState<TSet>> Seen, Queue<MatchingState<TSet>> ToExplore) args) => 98static void EnqueueAll(MatchingState<TSet>[] states, HashSet<MatchingState<TSet>> seen, Queue<MatchingState<TSet>> toExplore) 106static void EnqueueIfUnseen(MatchingState<TSet> state, HashSet<MatchingState<TSet>> seen, Queue<MatchingState<TSet>> queue)
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (4)
546HashSet<SymbolicRegexNode<TSet>> seenElems = []; 1820public HashSet<TSet> GetSets(SymbolicRegexBuilder<TSet> builder) 1822var sets = new HashSet<TSet>(); 1828private void CollectSets(SymbolicRegexBuilder<TSet> builder, HashSet<TSet> sets)
System\Text\RegularExpressions\Symbolic\UInt64Solver.cs (1)
33public List<ulong> GenerateMinterms(HashSet<ulong> constraints) => MintermGenerator<ulong>.GenerateMinterms(this, constraints);
System.Text.RegularExpressions.Generator (16)
RegexGenerator.Emitter.cs (6)
569var additionalDeclarations = new HashSet<string>(); 722var additionalDeclarations = new HashSet<string>(); 1491HashSet<string> additionalDeclarations = new(); 1713var seenChars = new HashSet<char>(); 5007private static string MatchCharacterClass(string chExpr, string charClass, bool negate, HashSet<string> additionalDeclarations, Dictionary<string, string[]> requiredHelpers) 5402private static void InsertAdditionalDeclarations(IndentedTextWriter writer, HashSet<string> declarations, int position, int indent)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (1)
334var whitespaceSet = new HashSet<char>(s_whitespaceChars);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (4)
158internal readonly HashSet<RegexNode> _isAtomicByAncestor = new(); // since the root is implicitly atomic, every tree will contain atomic-by-ancestor nodes 160internal readonly HashSet<RegexNode> _containsCapture = new(); // the root is a capture, so this will always contain at least the root node 162internal HashSet<RegexNode>? _mayBacktrack; 164internal HashSet<RegexNode>? _inLoops;
UpgradeToGeneratedRegexAnalyzer.cs (5)
51HashSet<IMethodSymbol> staticMethodsToDetect = GetMethodSymbolHash(regexTypeSymbol, 62static HashSet<IMethodSymbol> GetMethodSymbolHash(INamedTypeSymbol regexTypeSymbol, HashSet<string> methodNames) 68HashSet<IMethodSymbol> hash = new HashSet<IMethodSymbol>(SymbolEqualityComparer.Default); 90private static void AnalyzeInvocation(OperationAnalysisContext context, INamedTypeSymbol regexTypeSymbol, HashSet<IMethodSymbol> staticMethodsToDetect)
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\CombinedRateLimitLease.cs (1)
12private HashSet<string>? _metadataNames;
System.Windows.Controls.Ribbon (3)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonMenuItemsPanel.cs (3)
211HashSet<UIElement> starLayoutTargets = GetStarLayoutProviderTargets(); 258private HashSet<UIElement> GetStarLayoutProviderTargets() 260HashSet<UIElement> targets = new HashSet<UIElement>();
System.Windows.Forms (14)
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (3)
31private readonly HashSet<AxHost> _containerCache = []; 33private HashSet<Control>? _components; 370private HashSet<Control> GetComponents()
System\Windows\Forms\Application.cs (1)
986HashSet<Form> processedForms = new(s_forms.Count);
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (1)
263HashSet<int> usedIndices = [];
System\Windows\Forms\Controls\ListView\ListView.cs (1)
6996HashSet<int> groups = [];
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1044HashSet<Type>? typesWithEvents = _selectedObjects.Length > 10 ? new() : null;
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (4)
21private readonly HashSet<Control> _containerCache = []; 22private HashSet<Control>? _components; 161HashSet<Control>? components = GetComponents(); 187private HashSet<Control>? GetComponents()
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogButtonCollection.cs (1)
14private readonly HashSet<TaskDialogButton> _itemSet = [];
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogRadioButtonCollection.cs (1)
14private readonly HashSet<TaskDialogRadioButton> _itemSet = [];
System\Windows\Forms\ToolTip\ToolTip.cs (1)
69private readonly HashSet<Control> _created = [];
System.Windows.Forms.Design (15)
System\ComponentModel\Design\DesignerActionService.cs (1)
22private readonly HashSet<IComponent> _componentToVerbsEventHookedUp;
System\ComponentModel\Design\DesignSurfaceServiceContainer.cs (1)
11private readonly HashSet<Type> _fixedServices = [];
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (2)
23private readonly HashSet<string> _nameResolveGuard = []; 94HashSet<string> completeNames = [..objectNames];
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.PassThroughSerializationManager.cs (1)
14private readonly HashSet<string> _resolved = [];
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
1035HashSet<string> memberHash = new(StringComparer.CurrentCultureIgnoreCase);
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (3)
29private HashSet<IDesignerSerializationProvider>? _designerSerializationProviders; 30private HashSet<Type>? _defaultProviderTable; 905internal HashSet<IDesignerSerializationProvider> SerializationProviders
System\ComponentModel\Design\Serialization\LocalizationCodeDomSerializer.cs (1)
158private readonly HashSet<object> _table = [];
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (1)
35private HashSet<object>? _propertyFillAdded;
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
48private readonly HashSet<Glyph> _dragEnterReplies; // we keep track of whether glyph has already responded to a DragEnter this D&D.
System\Windows\Forms\Design\ControlCommandSet.cs (1)
297HashSet<Control> itemHash = new(sel.Count);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
50private readonly HashSet<DataGridViewColumn> _userAddedColumns = [];
System\Windows\Forms\Design\TabOrder.cs (1)
24private HashSet<Control>? _tabComplete;
System.Windows.Forms.Primitives.TestUtilities (2)
Extensions\AssertExtensions.cs (2)
409public static void Equal<T>(HashSet<T> expected, HashSet<T> actual)
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
207HashSet<ITypeSymbol> foundTypes = new(SymbolEqualityComparer.Default);
System.Windows.Input.Manipulations (3)
System\Windows\Input\Manipulations\ManipulationSequence.cs (3)
294out HashSet<int> removedManipulatorIds, 382HashSet<int> removedManipulatorIds; 468private void ProcessAddsAndRemoves(Int64 timestamp, List<ManipulatorState> addedManipulatorList, HashSet<int> removedManipulatorIds)
System.Xaml (19)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
1953private HashSet<string> _names;
System\Xaml\Context\NameFixupGraph.cs (1)
37private HashSet<object> _uninitializedObjectsAtParseEnd;
System\Xaml\Context\ObjectWriterContext.cs (3)
242HashSet<string> keys = new HashSet<string>(); 629public HashSet<XamlMember> CurrentAssignedProperties 634public HashSet<XamlMember> ParentAssignedProperties
System\Xaml\Context\ObjectWriterFrame.cs (2)
16private HashSet<XamlMember> _assignedProperties; 185public HashSet<XamlMember> AssignedProperties
System\Xaml\Context\XamlParserContext.cs (1)
83HashSet<string> keys = new HashSet<string>();
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1519HashSet<XamlMember> setProperties = onParent ? ctx.ParentAssignedProperties : ctx.CurrentAssignedProperties;
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
460HashSet<string> visited = new HashSet<string>();
System\Xaml\XamlObjectReader.cs (9)
72Stack<HashSet<string>> namesInCurrentScope = new Stack<HashSet<string>>(); 223public override void EnsureNoDuplicateNames(Stack<HashSet<string>> namesInCurrentScope) 986public virtual void EnsureNoDuplicateNames(Stack<HashSet<string>> namesInCurrentScope) { } 1035HashSet<string> namesOfAttributableProperties = FindAllAttributableProperties(out posOfFirstNonAttributableProperty); 1055private bool IsMemberOnlyDependentOnAttributableMembers(XamlMember member, HashSet<string> namesOfAttributableProperties) 1068private HashSet<string> FindAllAttributableProperties(out int posOfFirstNonAttributableProperty) 1071HashSet<string> namesOfAttributableProperties = new HashSet<string>(); 1776public override void EnsureNoDuplicateNames(Stack<HashSet<string>> namesInCurrentScope)
TaskUsageLogger (10)
TaskUsageLogger.cs (10)
53private HashSet<TaskData> _tasks; 57private Dictionary<string, HashSet<UsingTaskData>> _defaultTasksByToolset; 58private Dictionary<int, HashSet<UsingTaskData>> _tasksByProjectContextId; 77_defaultTasksByToolset = new Dictionary<string, HashSet<UsingTaskData>>(); 78_tasksByProjectContextId = new Dictionary<int, HashSet<UsingTaskData>>(); 202HashSet<UsingTaskData> usingTasks = new HashSet<UsingTaskData>(); 219HashSet<UsingTaskData> usingTasks; 245private void GatherAndEvaluatedTasksInFile(ProjectRootElement pre, Project containingProject, HashSet<UsingTaskData> usingTasks) 334HashSet<UsingTaskData> usingTasks = null; 353HashSet<UsingTaskData> defaultUsingTasks = null;
Templates.Blazor.Tests (4)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Blazor.WebAssembly.Auth.Tests (4)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Blazor.WebAssembly.Tests (4)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Mvc.Tests (4)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Templates.Tests (4)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
src\Shared\Process\ProcessExtensions.cs (1)
31var children = new HashSet<int>();
Test.Utilities (56)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
TestDiscoveryWorker (1)
Program.cs (1)
79var testsToWrite = new HashSet<string>();
Text.Analyzers (73)
CodeAnalysisDictionary.cs (2)
32private readonly HashSet<string> _recognizedWords; 44private readonly HashSet<string> _unrecognizedWords;
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
82public void AddRange(HashSet<T> values)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
58public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
281HashSet<TValue>? set = null;
src\Dependencies\Collections\Extensions\IListExtensions.cs (1)
44var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
712var set1 = new HashSet<T>(array1, comparer); 713var set2 = new HashSet<T>(array2, comparer); 840var set = comparer == EqualityComparer<TValue>.Default ? PooledHashSet<TValue>.GetInstance() : new HashSet<TValue>(comparer); 1286var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
18/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
76var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
76var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
12public static ImmutableArray<T> ToImmutableArray<T>(this HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (2)
107public static HashSet<ISymbol> GetAllDeclaredSymbols( 110var symbols = new HashSet<ISymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (1)
33public static void Push<T>(this Stack<T> stack, HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (3)
148/// Same as <see cref="HashSet{T}.SetEquals(IEnumerable{T})"/>, except this avoids allocations by 151private static bool SetEquals<T>(HashSet<T> set1, HashSet<T> set2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (1)
314var map = new HashSet<TextSpan>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
45private readonly HashSet<TextSpan> _indentationMap = []; 46private readonly HashSet<TextSpan> _suppressWrappingMap = []; 47private readonly HashSet<TextSpan> _suppressSpacingMap = []; 48private readonly HashSet<TextSpan> _suppressFormattingMap = []; 49private readonly HashSet<TextSpan> _anchorMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (3)
59var referencedElements = new HashSet<Guid>(); 123var symbolSpecificationNames = new HashSet<string>(); 136var namingStyleNames = new HashSet<string>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 117public static HashSet<T> AllocateAndClear<T>(this ObjectPool<HashSet<T>> pool) 119var set = pool.Allocate(); 183public static void ClearAndFree<T>(this ObjectPool<HashSet<T>> pool, HashSet<T> set)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 67return new PooledObject<HashSet<TItem>>( 127private static HashSet<TItem> Allocator<TItem>(ObjectPool<HashSet<TItem>> pool) 133private static void Releaser<TItem>(ObjectPool<HashSet<TItem>> pool, HashSet<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\SharedPools.cs (2)
43public static readonly ObjectPool<HashSet<string>> StringIgnoreCaseHashSet = 49public static readonly ObjectPool<HashSet<string>> StringHashSet =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AsyncLazy`1.cs (1)
76private HashSet<Request>? _requests;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
22private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (2)
95private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 97HashSet<INamedTypeSymbol>? symbols = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
97HashSet<INamespaceSymbol> conflicts, 126var addedSymbols = new HashSet<INamespaceSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
126var allAffectedStatements = new HashSet<TStatementSyntax>(referencingStatements.SelectMany(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (2)
24protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 29var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (2)
21private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 22private readonly HashSet<SyntaxNode> _seenExpressionGetType = [];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (2)
294var unusedImports = new HashSet<SyntaxNode>(); 312protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (2)
25var nameSet = nameSetPool.Object; 92var usedNames = usedNamesPool.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefLanguageServices.cs (1)
29private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
31private readonly HashSet<IDisposable> _ownedDisposableServices = new(ReferenceEqualityComparer.Instance);
xunit.assert (18)
CollectionAsserts.cs (1)
334 var set = new HashSet<T>(comparer);
EqualityAsserts.cs (2)
38 static readonly Type typeofHashSet = typeof(HashSet<>); 303 [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(HashSet<>))]
Sdk\AssertHelper.cs (8)
412 HashSet<object> expectedRefs, 413 HashSet<object> actualRefs, 565 HashSet<object> expectedRefs, 566 HashSet<object> actualRefs, 608 HashSet<object> expectedRefs, 609 HashSet<object> actualRefs, 698 HashSet<object> expectedRefs, 699 HashSet<object> actualRefs,
Sdk\CollectionTracker.cs (3)
201 var dictionaryYKeys = new HashSet<object>(dictionaryY.Keys.Cast<object>()); 344 var setX = new HashSet<object>(enumX.Cast<object>()); 345 var setY = new HashSet<object>(enumY.Cast<object>());
SetAsserts.cs (2)
87 HashSet<T> set) => 189 HashSet<T> set) =>
StringAsserts.cs (2)
1628 static readonly HashSet<char> charsLineEndings = new HashSet<char>() 1633 static readonly HashSet<char> charsWhitespace = new HashSet<char>()