24 types derived from HashSet
GenerateDocumentationAndConfigFiles (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
illink (1)
ILLink.RoslynAnalyzer (1)
src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (1)
33 private sealed class EnumerableValues : HashSet<TValue>
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Microsoft.CodeAnalysis (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
12internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Microsoft.CodeAnalysis.CodeStyle (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
12internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Collections.Package (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
12internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
12internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.PooledObjects.Package (1)
PooledHashSet.cs (1)
12internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Microsoft.CodeAnalysis.Threading.Package (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
12internal 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)
12internal sealed partial class PooledHashSet<T> : HashSet<T>
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
12internal 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\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
17internal sealed class PooledHashSet<T> : HashSet<T>, IDisposable
1936 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.Dashboard (7)
Components\Controls\ResourceDetails.razor.cs (1)
48private 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)
237public IReadOnlySet<AspireKeyboardShortcut> SubscribedShortcuts { get; } = new HashSet<AspireKeyboardShortcut>
Components\Pages\TraceDetail.razor.cs (1)
92var visibleViewModels = new HashSet<SpanWaterfallViewModel>();
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();
Aspire.Hosting (7)
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)
757var serviceNames = new HashSet<string>();
Publishing\ManifestPublishingContext.cs (1)
404var httpSchemesEncountered = new HashSet<string>();
ResourceBuilderExtensions.cs (1)
1871var processed = new HashSet<object>();
ResourceLoggerForwarderService.cs (1)
39var loggingResourceIds = new HashSet<string>();
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
418existingRoles = new HashSet<RoleDefinition>();
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
222var httpSchemesEncountered = new HashSet<string>();
Aspire.Hosting.Azure.ContainerRegistry (1)
AzureContainerRegistryExtensions.cs (1)
64.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)
89.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Docker (1)
DockerComposeServiceResource.cs (1)
23private static readonly HashSet<string> s_shellExecutables = new(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)
91var resourceIds = new HashSet<string>();
DistributedApplicationTests.cs (2)
859var expectedExeResources = new HashSet<string>() 868var 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)
239var foundSet = new HashSet<string>(PathComparer); 364var excludedNameSet = new HashSet<string>(PathComparer) 376var foundDllNameSet = new HashSet<string>(PathComparer); 377var neededDllNameSet = new HashSet<string>(PathComparer);
SolutionCheckerUtil.cs (1)
148var set = new HashSet<string>();
BuildValidator (1)
LocalReferenceResolver.cs (1)
45private 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 (2)
Program.cs (2)
268var fixableDiagnosticIds = new HashSet<string>(); 269var categories = new HashSet<string>();
illink (48)
ILLink.RoslynAnalyzer (4)
DataFlow\DynamicallyAccessedMembersBinder.cs (1)
375 public static void GetAllOnType (this ITypeSymbol type, bool declaredOnly, List<ISymbol> members) => GetAllOnType (type, declaredOnly, members, new HashSet<ITypeSymbol> (SymbolEqualityComparer.Default));
DataFlow\LValueFlowCaptureProvider.cs (1)
61 var rvalueFlowCaptureIds = new HashSet<CaptureId> ();
ISymbolExtensions.cs (1)
82 HashSet<string> featureSet = new ();
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
79 var values = new HashSet<DynamicallyAccessedMemberTypes> (
ILLink.Tasks (4)
CreateRuntimeRootDescriptorFile.cs (3)
98 readonly HashSet<string> defineConstants = new HashSet<string> (StringComparer.Ordinal); 430 members.fields ??= new HashSet<string> (); 451 members.methods ??= new HashSet<string> ();
LinkTask.cs (1)
350 HashSet<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 (2)
Http2\Http2TestBase.cs (1)
133protected readonly HashSet<int> _abortedStreamIds = new HashSet<int>();
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
39_blocks = new HashSet<DiagnosticPoolBlock>();
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)
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 (6)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
Metrics.Legacy (6)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
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 (8)
CascadingValue.cs (1)
157_subscribers ??= new HashSet<ComponentState>();
NavigationManager.cs (1)
412var 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 (2)
166public HashSet<string> AllRouteParameterNames { get; set; } = new(StringComparer.OrdinalIgnoreCase); 226var parameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
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)
146_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)
563var canceledHandlerTaskIds = new HashSet<string>(); 607var 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)
Hosting\WebAssemblyHostConfiguration.cs (1)
94var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
HotReload\MetadataUpdateHandlerInvoker.cs (1)
215var visited = new HashSet<string>(StringComparer.Ordinal);
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.Http.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)
28var validatableTypes = new HashSet<ValidatableType>(ValidatableTypeComparer.Instance);
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 (3)
Services\OpenApiGenerator.cs (3)
334var tags = new HashSet<OpenApiTagReference>(); 340document.Tags ??= new HashSet<OpenApiTag>(); 362document.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.OutputCaching (2)
Memory\MemoryOutputCacheStore.cs (1)
93keys = new HashSet<string>();
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.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)
39_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)
39_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 (5)
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\CertificateGeneration\UnixCertificateManager.cs (1)
502var availableCommands = new HashSet<string>();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
39_blocks = new HashSet<DiagnosticPoolBlock>();
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
39_blocks = new HashSet<DiagnosticPoolBlock>();
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
39_blocks = new HashSet<DiagnosticPoolBlock>();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
39_blocks = new HashSet<DiagnosticPoolBlock>();
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
39_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 (93)
AssemblyNameExtension.cs (1)
231return new HashSet<AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
BackEnd\BuildManager\BuildManager.cs (4)
302_activeNodes = new HashSet<int>(); 2055var blockedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes); 2056var finishedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes.Count); 2458configurationsOnNode = new HashSet<int>();
BackEnd\BuildManager\BuildParameters.cs (4)
288_propertiesFromCommandLine = other._propertiesFromCommandLine != null ? new HashSet<string>(other._propertiesFromCommandLine, StringComparer.OrdinalIgnoreCase) : null; 311WarningsAsErrors = other.WarningsAsErrors == null ? null : new HashSet<string>(other.WarningsAsErrors, StringComparer.OrdinalIgnoreCase); 312WarningsNotAsErrors = other.WarningsNotAsErrors == null ? null : new HashSet<string>(other.WarningsNotAsErrors, StringComparer.OrdinalIgnoreCase); 313WarningsAsMessages = other.WarningsAsMessages == null ? null : new HashSet<string>(other.WarningsAsMessages, StringComparer.OrdinalIgnoreCase);
BackEnd\BuildManager\CacheAggregator.cs (1)
68var seenConfigIds = new HashSet<int>();
BackEnd\BuildManager\RequestedProjectState.cs (2)
75HashSet<string> anotherPropertyFilters = new HashSet<string>(another.PropertyFilters); 112HashSet<string> anotherMetadata = new HashSet<string>(metadata);
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1163unresolvedConfigurationsAdded ??= new HashSet<int>();
BackEnd\Components\Communications\NodeInfo.cs (1)
40_configurationIDs = new HashSet<int>();
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
231_activeNodes = new HashSet<int>();
BackEnd\Components\Logging\LoggingService.cs (3)
217private readonly ISet<int> _buildSubmissionIdsThatHaveLoggedErrors = new HashSet<int>(); 222private readonly ISet<int> _buildSubmissionIdsThatHaveLoggedBuildcheckErrors = new HashSet<int>(); 764warningsByProject[key] = new HashSet<string>(codes, StringComparer.OrdinalIgnoreCase);
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
37private static readonly HashSet<string> s_projectSpecificPropertyNames = new(StringComparer.OrdinalIgnoreCase) { "TargetFramework", "Configuration", "Platform", "TargetPlatform", "OutputType" }; 524HashSet<ProjectCacheDescriptor> queriedCaches = new(ProjectCacheDescriptorEqualityComparer.Instance);
BackEnd\Components\RequestBuilder\BatchingEngine.cs (2)
136consumedItemReferences ??= new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default); 238consumedItemReferenceNames ??= new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default);
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (5)
89keepMetadata = new HashSet<string>(keepMetadataEvaluated); 98removeMetadata = new HashSet<string>(removeMetadataEvaluated); 107matchOnMetadata = new HashSet<string>(matchOnMetadataEvaluated); 520HashSet<string> excludesUnescapedForComparison = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 559HashSet<string> specificationsToFind = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1467loggingService.AddWarningsAsErrors(buildEventContext, new HashSet<string>());
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
817targetsChecked ??= new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default)
BackEnd\Components\RequestBuilder\TargetEntry.cs (2)
648targetOutputItems = new HashSet<TaskItem>(batchingBuckets[0].Expander.ExpandIntoTaskItemsLeaveEscaped(targetReturns, ExpanderOptions.ExpandAll, targetReturnsLocation)).ToArray(); 652HashSet<TaskItem> addedItems = new HashSet<TaskItem>();
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
1039var declaredProjects = new HashSet<string>(projectReferenceItems.Count + 1, FileUtilities.PathComparer);
BackEnd\Components\Scheduler\SchedulableRequest.cs (2)
138_requestsWeAreBlocking = new HashSet<SchedulableRequest>(); 526HashSet<SchedulableRequest> evaluatedRequests = new HashSet<SchedulableRequest>();
BackEnd\Components\Scheduler\Scheduler.cs (3)
701HashSet<int> idleNodes = new HashSet<int>(); 2321runningRequests[i] = new HashSet<int>(); 2633HashSet<SchedulableRequest> topLevelBlockingRequests = new HashSet<SchedulableRequest>();
BackEnd\Components\Scheduler\SchedulingData.cs (4)
279requests = new HashSet<SchedulableRequest>(); 341requestsAssignedToNode = new HashSet<SchedulableRequest>(); 352configurationsAssignedToNode = new HashSet<int>(); 410readyRequestsOnNode = new HashSet<SchedulableRequest>();
BackEnd\Components\Scheduler\SchedulingPlan.cs (2)
502private HashSet<PlanConfigData> _references = new HashSet<PlanConfigData>(); 507private HashSet<PlanConfigData> _referrers = new HashSet<PlanConfigData>();
BackEnd\Shared\BuildResult.cs (1)
120private static readonly HashSet<string> s_additionalEntriesKeys = new HashSet<string> { SpecialKeyForVersion };
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
37private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\EmbeddedResourceCheck.cs (1)
36private readonly HashSet<string> _projects = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\NoEnvironmentVariablePropertyCheck.cs (1)
29private readonly HashSet<EnvironmentVariableIdentityKey> _environmentVariablesCache = new HashSet<EnvironmentVariableIdentityKey>();
BuildCheck\Checks\PreferProjectReferenceCheck.cs (1)
39private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\PropertiesUsageCheck.cs (2)
122private HashSet<string> _readProperties = new(MSBuildNameIgnoreCaseComparer.Default); 238_readProperties = new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\SharedOutputPathCheck.cs (1)
37private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\TargetFrameworkConfusionCheck.cs (1)
35private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\TargetFrameworkUnexpectedCheck.cs (1)
37private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\UntrustedLocationCheck.cs (1)
37private HashSet<string> checkedProjects = new HashSet<string>();
Construction\Solution\SolutionFile.cs (3)
648_solutionFilter = new HashSet<string>(_pathComparer); 828var projectsByOriginalName = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 907HashSet<string> projectPaths = new HashSet<string>(_projectsInOrder.Count, _pathComparer);
Definition\Project.cs (1)
4079new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default));
Evaluation\Expander.cs (1)
2689HashSet<string> seenItems = new HashSet<string>(comparer);
Evaluation\ExpressionShredder.cs (1)
380pair.Items ??= new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default);
Evaluation\LazyItemEvaluator.OrderedItemDataCollection.cs (1)
156itemsToRemove ??= new HashSet<I>();
Evaluation\LazyItemEvaluator.RemoveOperation.cs (1)
80items ??= new HashSet<I>();
Evaluation\ProjectParser.cs (11)
31private static readonly HashSet<string> ValidAttributesOnlyConditionAndLabel = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label }; 36private static readonly HashSet<string> KnownAttributesOnItem = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.include, XMakeAttributes.exclude, XMakeAttributes.remove, XMakeAttributes.keepMetadata, XMakeAttributes.removeMetadata, XMakeAttributes.keepDuplicates, XMakeAttributes.update, XMakeAttributes.matchOnMetadata, XMakeAttributes.matchOnMetadataOptions }; 41private static readonly HashSet<string> KnownAttributesOnItemIgnoreCase = new HashSet<string>(KnownAttributesOnItem, StringComparer.OrdinalIgnoreCase); 46private static readonly HashSet<string> ValidAttributesOnImport = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.project, XMakeAttributes.sdk, XMakeAttributes.sdkVersion, XMakeAttributes.sdkMinimumVersion }; 51private static readonly HashSet<string> ValidAttributesOnUsingTask = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.taskName, XMakeAttributes.assemblyFile, XMakeAttributes.assemblyName, XMakeAttributes.taskFactory, XMakeAttributes.architecture, XMakeAttributes.runtime, XMakeAttributes.requiredPlatform, XMakeAttributes.requiredRuntime, XMakeAttributes.overrideUsingTask }; 56private static readonly HashSet<string> ValidAttributesOnTarget = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.name, XMakeAttributes.inputs, XMakeAttributes.outputs, XMakeAttributes.keepDuplicateOutputs, XMakeAttributes.dependsOnTargets, XMakeAttributes.beforeTargets, XMakeAttributes.afterTargets, XMakeAttributes.returns }; 61private static readonly HashSet<string> ValidAttributesOnOnError = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.executeTargets }; 66private static readonly HashSet<string> ValidAttributesOnOutput = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.taskParameter, XMakeAttributes.itemName, XMakeAttributes.propertyName }; 71private static readonly HashSet<string> ValidAttributesOnUsingTaskParameter = new HashSet<string> { XMakeAttributes.parameterType, XMakeAttributes.output, XMakeAttributes.required }; 76private static readonly HashSet<string> ValidAttributesOnUsingTaskBody = new HashSet<string> { XMakeAttributes.evaluate }; 482HashSet<String> listOfChildElementNames = new HashSet<string>();
Evaluation\PropertyTrackingEvaluatorDataWrapper.cs (1)
34private readonly HashSet<string> _overwrittenEnvironmentVariables = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
FileMatcher.cs (1)
2409resultsToExclude = new HashSet<string>();
Graph\GraphBuilder.cs (1)
178transitiveReferences = new();
Graph\ProjectGraph.cs (1)
616var encounteredEdges = new HashSet<ProjectGraphBuildRequest>();
Graph\ProjectGraphNode.cs (2)
21private readonly HashSet<ProjectGraphNode> _projectReferences = new HashSet<ProjectGraphNode>(); 22private readonly HashSet<ProjectGraphNode> _referencingProjects = new HashSet<ProjectGraphNode>();
Instance\ProjectInstance.cs (1)
1354_globalPropertiesToTreatAsLocal = new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default);
Instance\ProjectItemInstance.cs (1)
1631var thisNames = new HashSet<string>(capacity, MSBuildNameIgnoreCaseComparer.Default);
Logging\BinaryLogger\ProjectImportsCollector.cs (1)
34private readonly HashSet<string> _processedFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
PlatformNegotiation.cs (1)
36HashSet<string> projectReferencePlatforms = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Resources\Constants.cs (1)
67private static readonly HashSet<string> ReservedProperties = new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default)
TaskHostConfiguration.cs (3)
449collectionFactory: count => new HashSet<string>(count, StringComparer.OrdinalIgnoreCase)); 456collectionFactory: count => new HashSet<string>(count, StringComparer.OrdinalIgnoreCase)); 463collectionFactory: count => new HashSet<string>(count, StringComparer.OrdinalIgnoreCase));
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
Microsoft.Build.BuildCheck.UnitTests (1)
EditorConfig_Tests.cs (1)
694var expectedSet = new HashSet<T>(expected, comparer);
Microsoft.Build.CommandLine.UnitTests (3)
CommandLineSwitches_Tests.cs (3)
1277ISet<string> expectedWarningsAsErrors = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "a", "B", "c", "D", "e" }; 1325ISet<string> expectedWarningsAsErors = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "e", "f", "g" }; 1404ISet<string> expectedWarningsAsMessages = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "a", "B", "c", "D", "e" };
Microsoft.Build.Engine.OM.UnitTests (6)
ObjectModelRemoting\Helpers\TestCollectionGroup.cs (2)
207result.Add(this.Local, new HashSet<Project>(this.Local.Collection.LoadedProjects)); 211result.Add(r, new HashSet<Project>(r.Collection.LoadedProjects));
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (1)
473HashSet<Project> remotes = new HashSet<Project>();
ObjectModelRemoting\RemoteProjectsProviderMock\ExporterMock.cs (3)
237HashSet<object> views = new HashSet<object>(); 238HashSet<object> links = new HashSet<object>(); 239HashSet<object> remoters = new HashSet<object>();
Microsoft.Build.Engine.UnitTests (29)
BackEnd\BinaryTranslator_Tests.cs (5)
1184HashSet<BaseClass> values = new() 1190TranslationHelpers.GetWriteTranslator().TranslateHashSet(ref values, BaseClass.FactoryForDeserialization, capacity => new()); 1193TranslationHelpers.GetReadTranslator().TranslateHashSet(ref deserializedValues, BaseClass.FactoryForDeserialization, capacity => new()); 1202TranslationHelpers.GetWriteTranslator().TranslateHashSet(ref value, BaseClass.FactoryForDeserialization, capacity => new()); 1205TranslationHelpers.GetReadTranslator().TranslateHashSet(ref deserializedValue, BaseClass.FactoryForDeserialization, capacity => new());
BackEnd\BuildManager_Tests.cs (3)
3405_parameters.WarningsAsErrors = new HashSet<string>(); 3435_parameters.WarningsAsErrors = new HashSet<string> { "ABC123" }; 3466_parameters.WarningsAsErrors = new HashSet<string> { "ABC123" };
BackEnd\LoggingService_Tests.cs (9)
726HashSet<string> warningsAsErrors = new HashSet<string> 758HashSet<string> warningsAsErrors = new HashSet<string> 781HashSet<string> warningsAsErrors = new HashSet<string>(); 792ls.WarningsAsErrors = new HashSet<string>(); 810HashSet<string> warningsAsMessages = new HashSet<string> 843HashSet<string> warningsAsMessages = new HashSet<string> 864HashSet<string> warningsAsErrorsForProject = new HashSet<string> 900HashSet<string> warningsAsErrorsForProject = new HashSet<string>(); 917HashSet<string> warningsAsMessagesForProject = new HashSet<string>
BackEnd\TaskHostConfiguration_Tests.cs (3)
293HashSet<string> WarningsAsErrors = new HashSet<string>(); 633HashSet<string> WarningsAsErrors = new HashSet<string>(); 683HashSet<string> WarningsAsMessages = new HashSet<string>();
Definition\ProjectEvaluationContext_Tests.cs (2)
237var seenContexts = new HashSet<EvaluationContext>(); 305var seenContexts = new HashSet<EvaluationContext>();
Evaluation\Evaluator_Tests.cs (1)
2255HashSet<string> allProjectPropertiesNoDuplicateNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Evaluation\ExpressionShredder_Tests.cs (1)
1124HashSet<string> result = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
FileMatcher_Tests.cs (1)
2195ISet<string> files = new HashSet<string>();
Graph\GraphLoadedFromSolution_tests.cs (1)
528HashSet<string> propertiesToIgnore = new(StringComparer.OrdinalIgnoreCase)
Graph\ProjectGraph_Tests.cs (3)
1632var graph = new ProjectGraph(new HashSet<string> { entryProject1.Path, entryProject2.Path }); 2109referenceNumbersSet.ShouldBeSameIgnoringOrder(new HashSet<string> { "2", "3" }); 2115referenceNumbersSet.ShouldBeSameIgnoringOrder(new HashSet<string> { "2", "3", "4", "5" });
Microsoft.Build.Framework (3)
BinaryTranslator.cs (1)
306set = new HashSet<string>();
BuildCheck\EnumerableExtensions.cs (2)
48return new HashSet<T>(capacity, equalityComparer); 64return new HashSet<T>(source, equalityComparer);
Microsoft.Build.Framework.UnitTests (4)
BuildCheckTracingEventArgs_Tests.cs (4)
28new HashSet<DiagnosticSeverity>() { DiagnosticSeverity.Default, DiagnosticSeverity.Suggestion }, 29new HashSet<string>() { "aa", "b" }, 5, 2, 8, true, TimeSpan.FromSeconds(123)); 32new HashSet<DiagnosticSeverity>(), 33new HashSet<string>(), 0, 0, 500, false, TimeSpan.FromSeconds(1234));
Microsoft.Build.Tasks.Core (41)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigCache.cs (1)
48_filesInDirectories = new(assemblyFoldersFromConfig.AsParallel()
AssemblyDependency\Reference.cs (3)
32private HashSet<Reference> _dependees = new HashSet<Reference>(); 38private HashSet<Reference> _dependencies = new HashSet<Reference>(); 123private HashSet<AssemblyRemapping> _remappedAssemblyNames = new HashSet<AssemblyRemapping>();
AssemblyDependency\ReferenceTable.cs (4)
41private readonly HashSet<string> _externallyResolvedPrimaryReferences = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 1239var parentReferencesAdded = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 1870var conflictingFullNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 2051var seenFrameworkDirectories = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
AssemblyFoldersEx.cs (1)
54private HashSet<string> _uniqueDirectoryPaths = new HashSet<string>();
AssemblyNameExtension.cs (1)
231return new HashSet<AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
BootstrapperUtil\BootstrapperBuilder.cs (1)
427var folders = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Delete.cs (1)
107var deletedFilesSet = new HashSet<string>(FileUtilities.PathComparer);
FileMatcher.cs (1)
2409resultsToExclude = new HashSet<string>();
GenerateResource.cs (1)
1467HashSet<string> set = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
GetSDKReferenceFiles.cs (4)
39private readonly HashSet<ResolvedReferenceAssembly> _resolvedReferences = new HashSet<ResolvedReferenceAssembly>(); 44private readonly HashSet<ResolvedRedistFile> _resolveRedistFiles = new HashSet<ResolvedRedistFile>(); 304var resolvedRedistFileSet = new HashSet<ResolvedRedistFile>(); 368var resolvedReferenceAssemblies = new HashSet<ResolvedReferenceAssembly>();
ListOperators\RemoveDuplicates.cs (1)
48var alreadySeen = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
MakeDir.cs (1)
46var directoriesSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
PlatformNegotiation.cs (1)
36HashSet<string> projectReferencePlatforms = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ResolveProjectBase.cs (1)
42private readonly HashSet<string> _cachedProjectReferencesByAbsolutePath = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ResolveSDKReference.cs (6)
315var sdkNamesOnReferenceItems = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 329var sdkReferenceItems = new HashSet<SDKReference>(); 338var sdksNotCompatibleWithOtherSDKs = new HashSet<SDKReference>(); 365productFamilyNameToSDK.Add(reference.ProductFamilyName, new HashSet<SDKReference> { reference }); 380sdkNameToSDK.Add(reference.SimpleName, new HashSet<SDKReference> { reference }); 403var sdksAlreadyErrorOrWarnedFor = new HashSet<SDKReference>();
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (3)
74{ "CS", new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "CSharp", "C#" } }, 75{ "VB", new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "VisualBasic", "Visual Basic" } }, 531ISet<string> resolvedAssemblyReferences = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
RoslynCodeTaskFactory\RoslynCodeTaskFactoryTaskInfo.cs (2)
31public ISet<string> Namespaces { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 36public ISet<string> References { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
SystemState.cs (1)
569HashSet<string> assembliesFound = new HashSet<string>();
Touch.cs (1)
90var touchedFilesSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
Microsoft.Build.Tasks.UnitTests (9)
ResolveSDKReference_Tests.cs (7)
95HashSet<SDKReference> resolvedSDKsEmpty = new HashSet<SDKReference>(); 98HashSet<SDKReference> resolvedSDKs = new HashSet<SDKReference>() { new SDKReference(new TaskItem(), "bar", "1.0"), new SDKReference(new TaskItem(), "foo", "1.0"), new SDKReference(new TaskItem(), "Newt", "1.0") }; 104result = ResolveSDKReference.GetUnresolvedDependentSDKs(new HashSet<SDKReference>(), dependentSDKs); 318HashSet<SDKReference> references = new HashSet<SDKReference>(); 359HashSet<SDKReference> references = new HashSet<SDKReference>(); 390references = new HashSet<SDKReference>(); 4203new HashSet<string>() { "sdkName" },
RoslynCodeTaskFactory_Tests.cs (2)
561expectedNamespaces: new HashSet<string> 581expectedReferences: new HashSet<string>
Microsoft.Build.Utilities.Core (3)
AssemblyFoldersEx.cs (1)
54private HashSet<string> _uniqueDirectoryPaths = new HashSet<string>();
FileMatcher.cs (1)
2409resultsToExclude = new HashSet<string>();
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
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 (50)
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)
837var refSet = new HashSet<MetadataReference>(this.ExternalReferences); 2138var uniqueResourceNames = new HashSet<string>(); 2142var uniqueFileNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
DiagnosticAnalyzer\AnalysisResultBuilder.cs (2)
44_completedAnalyzersForCompilation = new HashSet<DiagnosticAnalyzer>(); 131var completedAnalyzers = new HashSet<DiagnosticAnalyzer> { analyzer };
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
185set = new(OriginalPathComparer);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2897descendantDeclsToSkip ??= new HashSet<SyntaxNode>();
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (1)
204memberSet ??= new HashSet<ISymbol>();
Emit\CommonPEModuleBuilder.cs (1)
665names = 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)
415HashSet<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 (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
Syntax\SyntaxDiffer.cs (2)
24private readonly HashSet<GreenNode> _nodeSimilaritySet = new HashSet<GreenNode>(); 25private readonly HashSet<string> _tokenTextSimilaritySet = new HashSet<string>();
Text\CompositeText.cs (1)
364= new ObjectPool<HashSet<SourceText>>(() => new HashSet<SourceText>(), 5);
Microsoft.CodeAnalysis.Analyzers (7)
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
117var processedTypes = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
Microsoft.CodeAnalysis.AnalyzerUtilities (7)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
279_returnValueOperations = OwningSymbol is IMethodSymbol method && !method.ReturnsVoid ? new HashSet<IOperation>() : null;
Microsoft.CodeAnalysis.BannedApiAnalyzers (6)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
Microsoft.CodeAnalysis.CodeStyle (18)
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\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
104symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
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>();
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
439var 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\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (1)
30var unnecessaryImports = new HashSet<T>(this);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
294var unusedImports = new HashSet<SyntaxNode>();
Microsoft.CodeAnalysis.Collections.Package (6)
Extensions\IEnumerableExtensions.cs (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
Microsoft.CodeAnalysis.CSharp (82)
Binder\Binder_Attributes.cs (1)
496boundNamedArgumentsSet = new HashSet<string>();
Binder\Binder_Lookup.cs (4)
979var allMembers = new HashSet<Symbol>(comparer); 980var conflictingMembers = new HashSet<Symbol>(comparer); 1159var visited = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.ConsiderEverything); 1219seenInterfaces = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.IgnoringNullable);
Binder\Binder_Operators.cs (1)
2693var existing = new HashSet<MethodSymbol>(PairedOperatorComparer.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\OverloadResolution\MethodTypeInference.cs (1)
544collectedBounds[methodTypeParameterIndex] = new HashSet<TypeWithAnnotations>(TypeWithAnnotations.EqualsComparer.ConsiderEverythingComparer);
CommandLine\CSharpCompiler.cs (1)
99var uniqueFilePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Compilation\CSharpCompilation.cs (3)
2617if (_lazyCompilationUnitCompletedTrees == null) Interlocked.CompareExchange(ref _lazyCompilationUnitCompletedTrees, new HashSet<SyntaxTree>(), null); 2971var parseOptionsReported = new HashSet<ParseOptions>(); 4885var result = new HashSet<Symbol>();
Compilation\CSharpSemanticModel.cs (1)
4212HashSet<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)
215var set = new HashSet<string>();
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
990seen = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.CLRSignature);
Emitter\Model\PEModuleBuilder.cs (1)
656var seenTopLevelForwardedTypes = new HashSet<NamedTypeSymbol>();
FlowAnalysis\AlwaysAssignedWalker.cs (1)
25private 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\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)
40private 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)
37private 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)
45var symbolsForExplicitlyImplementedAccessors = new HashSet<T>();
Symbols\Source\LambdaSymbol.cs (1)
70_declarationDependencies = new HashSet<AssemblySymbol>();
Symbols\Source\LocalFunctionSymbol.cs (1)
48_declarationDependencies = new HashSet<AssemblySymbol>();
Symbols\Source\SourceAssemblySymbol.cs (5)
992var knownModuleNames = new HashSet<String>(StringComparer.OrdinalIgnoreCase); 1215uniqueAttributes = new HashSet<CSharpAttributeData>(comparer: CommonAttributeDataComparer.Instance); 1408forwardedTypes = new HashSet<NamedTypeSymbol>(); 2255forwardedTypes = new HashSet<NamedTypeSymbol>() { (NamedTypeSymbol)forwardedType }; 2721handledUnreadFields = new HashSet<FieldSymbol>();
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1980var conversionsAsConversions = new HashSet<MethodSymbol>(ConversionSignatureComparer.Comparer);
Symbols\SubstitutedNamedTypeSymbol.cs (1)
276var replacedFields = new HashSet<Symbol>(ReferenceEqualityComparer.Instance);
Symbols\Symbol_Attributes.cs (2)
485var toRemove = new HashSet<Diagnostic>(ReferenceEqualityComparer.Instance); 850HashSet<NamedTypeSymbol> uniqueAttributeTypes = new HashSet<NamedTypeSymbol>();
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
199var 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)
1544checkedTypes = 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 (3)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
55var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>();
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)
59var accessorLists = new HashSet<AccessorListSyntax>();
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
62var nodesToTrack = new HashSet<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
20private 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) 98public static readonly ISet<SyntaxKind> ClassInterfaceRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 105public static readonly ISet<SyntaxKind> ClassRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 111public static readonly ISet<SyntaxKind> ClassStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 119public static readonly ISet<SyntaxKind> StructOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 125public 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)
1421var 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 (18)
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)
43Assert.True(expected.All(new HashSet<string>().Add), $"Duplicates were found in '{nameof(expected)}'"); 44Assert.True(actual.All(new HashSet<string>().Add), $"Duplicates were found in '{nameof(actual)}'");
Microsoft.CodeAnalysis.CSharp.Features (61)
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 (1)
15private static readonly ISet<SyntaxKind> s_validClassModifiers = new HashSet<SyntaxKind>(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 (1)
15private static readonly ISet<SyntaxKind> s_validClassInterfaceRecordModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
Completion\KeywordRecommenders\VolatileKeywordRecommender.cs (1)
15private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
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\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
55var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>();
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)
59var accessorLists = new HashSet<AccessorListSyntax>();
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
62var nodesToTrack = new HashSet<SyntaxNode>();
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
151var tempMatches = new HashSet<CastExpressionSyntax>();
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (1)
69var 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)
157886var reportedDiagnostics = new HashSet<Diagnostic>();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (13)
Compilation\CompilationAPITests.cs (2)
518var hs = new HashSet<MetadataReference> { ref1, ref2, ref3 }; 845var 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\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)
20private 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) 98public static readonly ISet<SyntaxKind> ClassInterfaceRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 105public static readonly ISet<SyntaxKind> ClassRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 111public static readonly ISet<SyntaxKind> ClassStructRecordTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 119public static readonly ISet<SyntaxKind> StructOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer) 125public 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)
216var openBuffers = new HashSet<ITextBuffer>();
Shared\Extensions\ITextViewExtensions.cs (1)
24return new HashSet<IContentType>(
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (1)
156_tagSpanSetPool = new ObjectPool<HashSet<TagSpan<TTag>>>(() => new HashSet<TagSpan<TTag>>(this), trimOnFree: false);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Classification\AbstractClassifierTests.cs (1)
294var classificationsSpans = new HashSet<TextSpan>();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (15)
CodeFixes\CodeFixServiceTests.cs (2)
114var uniqueTitles = new HashSet<string>(); 1187var 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.Features (40)
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)
61var uniqueIdentities = new HashSet<AssemblyIdentity>();
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
78var 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\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (3)
99var insertionOnlyChanges = new HashSet<TextChange>(); 102var allAddedProjectReferences = new HashSet<ProjectReference>(); 103var allAddedMetaDataReferences = new HashSet<MetadataReference>();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
261var spine = new HashSet<SyntaxNode>();
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
161var handledFolders = new HashSet<string>(StringComparer.Ordinal);
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
213var set = new HashSet<Diagnostic>(diagnosticsA, DiagnosticComparer.Instance);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
209var spanSet = new HashSet<DocumentSpan>();
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (1)
57: new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
217var set = new HashSet<string>();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
529_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());
FindUsages\AbstractFindUsagesService_FindImplementations.cs (2)
96var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 109var seenLocations = new HashSet<(string filePath, TextSpan span)>();
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
15private readonly ISet<INamedTypeSymbol> _seenTypes = new HashSet<INamedTypeSymbol>();
PdbSourceDocument\SymbolSourceDocumentFinder.cs (1)
16var docList = new HashSet<DocumentHandle>();
PullMemberUp\MembersPuller.cs (1)
506var 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 (1)
136private readonly HashSet<IPropertySymbol> _propertiesWithShadowGetAccessorUsages = new(OriginalDefinitionSymbolEqualityComparer.Instance);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
439var 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)
101var dependencyNames = new HashSet<string>();
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
166var 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 (7)
Interactive\Core\InteractiveHost.Service.cs (1)
734var uniqueDirectories = new HashSet<string>(directories);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
Microsoft.CodeAnalysis.LanguageServer (3)
HostWorkspace\LoadedProject.cs (2)
244var newItems = new HashSet<T>(loadedCollection, comparer); 245var 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.PublicApiAnalyzers (4)
DeclarePublicApiAnalyzer.Impl.cs (1)
515var publicApiLinesForSiblingsOfSymbol = new HashSet<string>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
Microsoft.CodeAnalysis.Remote.ServiceHub (8)
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\ProcessTelemetry\RemoteProcessTelemetryService.cs (1)
81var functionIdsSet = new HashSet<FunctionId>(functionIds);
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
AbstractResxGenerator.cs (1)
150var names = new HashSet<string>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
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)
39_lazyVisitedObjects ??= new HashSet<object>(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.Test.Utilities (22)
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)
958var 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);
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 (6)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
Microsoft.CodeAnalysis.UnitTests (27)
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)
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)
634HashSet<T> firstValues = new HashSet<T>(count); 635HashSet<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)
35Private 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)
31Private 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)
26Private 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)
36Dim symbolsForExplicitlyImplementedAccessors = New HashSet(Of T)()
Symbols\ReducedExtensionMethodSymbol.vb (1)
64Dim hashSetOfTypeParametersToFix As New HashSet(Of TypeParameterSymbol)
Symbols\Source\SourceNamedTypeSymbol.vb (3)
883Dim constraintTypes1 = New HashSet(Of TypeSymbol) 1166Dim interfacesInThisPartial As New HashSet(Of NamedTypeSymbol)() 1223Dim interfacesInThisPartial As New HashSet(Of TypeSymbol)()
Symbols\Symbol_Attributes.vb (1)
464Dim 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.VisualBasic.Syntax.UnitTests (1)
IncrementalParser\SyntaxDifferences.vb (1)
16Dim hashSet = New HashSet(Of GreenNode)
Microsoft.CodeAnalysis.Workspaces (45)
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>(); 68var set = new HashSet<ILogger>();
Rename\ConflictEngine\ConflictResolver.Session.cs (2)
116var documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(documentsByProject); 703var documentIds = new HashSet<DocumentId>();
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
70var appliedTextSpans = new HashSet<TextSpan>(); 180var 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 (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
104symbols ??= new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
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\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)
30var 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.BuildHost (9)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
27_set = new HashSet<T>();
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
167return new HashSet<T>(source, comparer); 177return source as ISet<T> ?? new HashSet<T>(source);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var 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)
221var projectPaths = new HashSet<string>(); 222var outputFilePaths = new HashSet<string>(); 311var projectPaths = new HashSet<string>(); 312var outputFilePaths = new HashSet<string>(); 326var expectedNames = new HashSet<string>() 334var actualNames = new HashSet<string>();
SolutionGeneration.cs (1)
66var 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)
332var expectedMatchedLines = new HashSet<int> { 3, 13, 14 }; 396var 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.AsmDiff (7)
AssemblySet.cs (7)
29var includedAssemblySet = new HashSet<IAssembly>(includedAssemblies); 55var processedSet = new HashSet<IAssemblyReference>(); 145var loadedAssembliesSet = new HashSet<IAssembly>(loadedAssemblies); 159var processedSet = new HashSet<IAssembly>(); 180var includedAssemblySet = new HashSet<IAssembly>(includedAssemblies); 185var requiredAssemblySet = new HashSet<IAssembly>(GetRequiredAssemblies(includedAssemblySet)); 194var processedIdentities = new HashSet<AssemblyIdentity>();
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)
541symbolAssets : new HashSet<BlobArtifactModel>(); 1137PackagesByCategory[categoryKey] = new HashSet<PackageArtifactModel>() { packageAsset }; 1165BlobsByCategory[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)
158packages = new HashSet<string>(); 596filesErrored = new HashSet<SignedFileContentKey>(); 768packages = 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)
408private readonly HashSet<string> specialExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
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.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), 583HashSet<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)
27public 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]" }, 250SourceIpAddresses = new HashSet<string> { "[::1]" }, 268SourceIpAddresses = 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 (2)
Internal\MatcherContext.cs (2)
25private readonly HashSet<LiteralPathSegment> _declaredLiteralFileSegments = new HashSet<LiteralPathSegment>(); 45_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.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 (10)
CommonControls\MemberSelectionViewModel.cs (2)
173var visited = new HashSet<ISymbol>(); 174var result = new HashSet<ISymbol>();
MoveStaticMembers\StaticMemberSelectionViewModel.cs (2)
88var visited = new HashSet<ISymbol>(); 89var result = new HashSet<ISymbol>();
Preview\PreviewEngine.cs (1)
160var linkedDocumentIds = new HashSet<DocumentId>();
Progression\GraphBuilder.cs (1)
33private readonly ISet<GraphNode> _createdNodes = new HashSet<GraphNode>();
Progression\GraphQueries\ContainsGraphQuery.cs (1)
27var newNodes = new HashSet<GraphNode>();
Progression\GraphQueries\InheritsGraphQuery.cs (1)
28var newNodes = new HashSet<GraphNode>();
ProjectSystem\RuleSets\RuleSetEventHandler.cs (1)
184var ruleSetDeletions = new HashSet<string>(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" });
MSBuild (14)
AssemblyNameExtension.cs (1)
231return new HashSet<AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
CommandLineSwitches.cs (2)
384HashSet<string> parameterizedSwitchResourceIds = new HashSet<string>(); 401HashSet<string> parameterlessSwitchResourceIds = new HashSet<string>();
CoreCLRAssemblyLoader.cs (1)
24private readonly HashSet<string> _dependencyPaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
TaskHostConfiguration.cs (3)
449collectionFactory: count => new HashSet<string>(count, StringComparer.OrdinalIgnoreCase)); 456collectionFactory: count => new HashSet<string>(count, StringComparer.OrdinalIgnoreCase)); 463collectionFactory: count => new HashSet<string>(count, StringComparer.OrdinalIgnoreCase));
XMake.cs (1)
3281ISet<string> warningSwitches = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
MSBuildTaskHost (11)
AssemblyNameExtension.cs (1)
231return new HashSet<AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
BinaryTranslator.cs (1)
306set = new HashSet<string>();
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
TaskHostConfiguration.cs (3)
447collectionFactory: count => new HashSet<string>(StringComparer.OrdinalIgnoreCase)); 454collectionFactory: count => new HashSet<string>(StringComparer.OrdinalIgnoreCase)); 461collectionFactory: count => new HashSet<string>(StringComparer.OrdinalIgnoreCase));
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
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)
151var outputSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 225var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Roslyn.Diagnostics.Analyzers (6)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\TelemetryPanel.xaml.cs (1)
60var seenType = new HashSet<Type>();
Roslyn.VisualStudio.Next.UnitTests (2)
Options\VisualStudioOptionStorageTests.cs (1)
290var set = new HashSet<string>();
Services\ServiceHubServicesTests.cs (1)
1874var 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)
320private 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\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
41s_registrations[signo] = tokens = new HashSet<Token>();
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 (1)
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 (5)
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);
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 (9)
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (1)
281HashSet<string> duplicateAttributeCheck = new();
System\Security\Cryptography\X509Certificates\CertificatePolicy.cs (2)
316HashSet<string> oids = new HashSet<string>(); 346HashSet<string> policies = new HashSet<string>();
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
1012HashSet<string?> usedOids = new HashSet<string?>(CertificateExtensions.Count);
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (4)
153var uniqueRootCerts = new HashSet<X509Certificate2>(); 154var uniqueIntermediateCerts = new HashSet<X509Certificate2>(); 155var processedFiles = new HashSet<(long Ino, long Dev)>(); 350var set = new HashSet<string>(directories, StringComparer.Ordinal);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
86var loadedCerts = new HashSet<X509Certificate2>();
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\SignedCms.cs (1)
564var 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 (1)
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(); 1519if (!(memberInitializerNames ??= new()).Add(property.MemberName)) 1811HashSet<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 (1)
System\Windows\Forms\Application.cs (1)
986HashSet<Form> processedForms = new(s_forms.Count);
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 (4)
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
TestDiscoveryWorker (1)
Program.cs (1)
82var testsToWrite = new HashSet<string>();
Text.Analyzers (8)
CodeAnalysisDictionary.cs (2)
53_recognizedWords = new HashSet<string>(recognizedWords, StringComparer.OrdinalIgnoreCase); 54_unrecognizedWords = new HashSet<string>(unrecognizedWords, StringComparer.OrdinalIgnoreCase);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\DoNotCatchGeneralUnlessRethrown.cs (1)
120public ISet<ICatchClauseOperation> CatchClausesForDisallowedTypesWithoutRethrow { get; } = new HashSet<ICatchClauseOperation>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IEnumerableExtensions.cs (1)
43return source as ISet<T> ?? new HashSet<T>(source);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
66var uniqueRulesetPaths = new HashSet<string>();
xunit.assert (10)
CollectionAsserts.cs (1)
334 var set = new HashSet<T>(comparer);
Sdk\AssertHelper.cs (2)
378 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>()
3361 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.Dashboard (9)
Components\Controls\ResourceDetails.razor.cs (1)
48private readonly HashSet<string> _unmaskedItemNames = new();
Components\Dialogs\TextVisualizerDialog.razor.cs (1)
34public HashSet<string?> EnabledOptions { get; } = [];
Components\Pages\Resources.razor.cs (1)
91private readonly HashSet<string> _collapsedResourceNames = new(StringComparers.ResourceName);
Components\Pages\TraceDetail.razor.cs (1)
92var visibleViewModels = new HashSet<SpanWaterfallViewModel>();
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();
src\Shared\Model\KnownResourceTypes.cs (1)
13private static readonly HashSet<string> s_builtInResources = ["AppIdentityResource", "AttuResource", "AzureAppConfigurationResource", "AzureApplicationInsightsResource", "AzureBicepResource", "AzureBlobStorageResource", "AzureContainerAppEnvironmentResource", "AzureCosmosDBContainerResource", "AzureCosmosDBDatabaseResource", "AzureCosmosDBEmulatorResource", "AzureCosmosDBResource", "AzureEventHubConsumerGroupResource", "AzureEventHubResource", "AzureEventHubsEmulatorResource", "AzureEventHubsResource", "AzureFunctionsProjectResource", "AzureKeyVaultResource", "AzureLogAnalyticsWorkspaceResource", "AzureOpenAIDeploymentResource", "AzureOpenAIResource", "AzurePostgresFlexibleServerDatabaseResource", "AzurePostgresFlexibleServerResource", "AzurePostgresResource", "AzureProvisioningResource", "AzureQueueStorageResource", "AzureRedisCacheResource", "AzureRedisResource", "AzureSearchResource", "AzureServiceBusEmulatorResource", "AzureServiceBusQueueResource", "AzureServiceBusResource", "AzureServiceBusSubscriptionResource", "AzureServiceBusTopicResource", "AzureSignalREmulatorResource", "AzureSignalRResource", "AzureSqlDatabaseResource", "AzureSqlServerResource", "AzureStorageEmulatorResource", "AzureStorageResource", "AzureTableStorageResource", "AzureWebPubSubHubResource", "AzureWebPubSubResource", "ConnectionStringParameterResource", "ConnectionStringResource", Container, "DockerComposeEnvironmentResource", "DockerComposeServiceResource", "ElasticsearchResource", Executable, "ExecutableContainerResource", "GarnetResource", "KafkaServerResource", "KafkaUIContainerResource", "KeycloakResource", "KubernetesEnvironmentResource", "KubernetesResource", "MilvusDatabaseResource", "MilvusServerResource", "MongoDBDatabaseResource", "MongoDBServerResource", "MongoExpressContainerResource", "MySqlDatabaseResource", "MySqlServerResource", "NatsServerResource", "NodeAppResource", "OracleDatabaseResource", "OracleDatabaseServerResource", "ParameterResource", "PgAdminContainerResource", "PgWebContainerResource", "PhpMyAdminContainerResource", "PostgresDatabaseResource", "PostgresServerResource", Project, "ProjectContainerResource", "PythonAppResource", "PythonProjectResource", "QdrantServerResource", "RabbitMQServerResource", "RedisCommanderResource", "RedisInsightResource", "RedisResource", "Resource", "SeqResource", "SqlServerDatabaseResource", "SqlServerServerResource", "ValkeyResource"];
Aspire.Hosting (15)
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)
757var serviceNames = new HashSet<string>();
Dcp\DcpNameGenerator.cs (2)
81public string GetServiceName(IResource resource, EndpointAnnotation endpoint, bool hasMultipleEndpoints, HashSet<string> allServiceNames) 90private static string GenerateUniqueServiceName(HashSet<string> serviceNames, string candidateName)
Dcp\ResourceSnapshotBuilder.cs (1)
204var serviceEndpoints = new HashSet<(string EndpointName, string ServiceMetadataName)>(resourceServices.Where(s => !string.IsNullOrEmpty(s.EndpointName)).Select(s => (s.EndpointName!, s.Metadata.Name)));
DistributedApplicationBuilder.cs (1)
425var 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)
1871var processed = new HashSet<object>();
ResourceLoggerForwarderService.cs (1)
39var loggingResourceIds = new HashSet<string>();
src\Shared\Model\KnownResourceTypes.cs (1)
13private static readonly HashSet<string> s_builtInResources = ["AppIdentityResource", "AttuResource", "AzureAppConfigurationResource", "AzureApplicationInsightsResource", "AzureBicepResource", "AzureBlobStorageResource", "AzureContainerAppEnvironmentResource", "AzureCosmosDBContainerResource", "AzureCosmosDBDatabaseResource", "AzureCosmosDBEmulatorResource", "AzureCosmosDBResource", "AzureEventHubConsumerGroupResource", "AzureEventHubResource", "AzureEventHubsEmulatorResource", "AzureEventHubsResource", "AzureFunctionsProjectResource", "AzureKeyVaultResource", "AzureLogAnalyticsWorkspaceResource", "AzureOpenAIDeploymentResource", "AzureOpenAIResource", "AzurePostgresFlexibleServerDatabaseResource", "AzurePostgresFlexibleServerResource", "AzurePostgresResource", "AzureProvisioningResource", "AzureQueueStorageResource", "AzureRedisCacheResource", "AzureRedisResource", "AzureSearchResource", "AzureServiceBusEmulatorResource", "AzureServiceBusQueueResource", "AzureServiceBusResource", "AzureServiceBusSubscriptionResource", "AzureServiceBusTopicResource", "AzureSignalREmulatorResource", "AzureSignalRResource", "AzureSqlDatabaseResource", "AzureSqlServerResource", "AzureStorageEmulatorResource", "AzureStorageResource", "AzureTableStorageResource", "AzureWebPubSubHubResource", "AzureWebPubSubResource", "ConnectionStringParameterResource", "ConnectionStringResource", Container, "DockerComposeEnvironmentResource", "DockerComposeServiceResource", "ElasticsearchResource", Executable, "ExecutableContainerResource", "GarnetResource", "KafkaServerResource", "KafkaUIContainerResource", "KeycloakResource", "KubernetesEnvironmentResource", "KubernetesResource", "MilvusDatabaseResource", "MilvusServerResource", "MongoDBDatabaseResource", "MongoDBServerResource", "MongoExpressContainerResource", "MySqlDatabaseResource", "MySqlServerResource", "NatsServerResource", "NodeAppResource", "OracleDatabaseResource", "OracleDatabaseServerResource", "ParameterResource", "PgAdminContainerResource", "PgWebContainerResource", "PhpMyAdminContainerResource", "PostgresDatabaseResource", "PostgresServerResource", Project, "ProjectContainerResource", "PythonAppResource", "PythonProjectResource", "QdrantServerResource", "RabbitMQServerResource", "RedisCommanderResource", "RedisInsightResource", "RedisResource", "Resource", "SeqResource", "SqlServerDatabaseResource", "SqlServerServerResource", "ValkeyResource"];
src\Shared\PortAllocator.cs (1)
16private readonly HashSet<int> _usedPorts = [];
Aspire.Hosting.Azure (9)
AzurePublishingContext.cs (1)
323private static void Visit(object? value, Action<object> visitor, HashSet<object> visited)
AzureResourcePreparer.cs (8)
102var globalRoleAssignments = new Dictionary<AzureProvisioningResource, HashSet<RoleDefinition>>(); 138var azureReferences = await GetAzureReferences(resource, cancellationToken).ConfigureAwait(false); 319private async Task<HashSet<IAzureResource>> GetAzureReferences(IResource resource, CancellationToken cancellationToken) 321HashSet<IAzureResource> azureReferences = []; 356private static void ProcessAzureReferences(HashSet<IAzureResource> azureReferences, object value) 414private static void AppendGlobalRoleAssignments(Dictionary<AzureProvisioningResource, HashSet<RoleDefinition>> globalRoleAssignments, AzureProvisioningResource azureResource, IEnumerable<RoleDefinition> newRoles) 416if (!globalRoleAssignments.TryGetValue(azureResource, out var existingRoles)) 425private async Task CreateGlobalRoleAssignments(DistributedApplicationModel appModel, Dictionary<AzureProvisioningResource, HashSet<RoleDefinition>> globalRoleAssignments, AzureProvisioningOptions provisioningOptions)
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)
222var httpSchemesEncountered = new HashSet<string>(); 830private 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 (2)
DockerComposeServiceResource.cs (1)
23private static readonly HashSet<string> s_shellExecutables = new(StringComparer.OrdinalIgnoreCase)
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)
91var resourceIds = new HashSet<string>();
DistributedApplicationTests.cs (2)
859var expectedExeResources = new HashSet<string>() 868var 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)
239var foundSet = new HashSet<string>(PathComparer); 364var excludedNameSet = new HashSet<string>(PathComparer) 376var foundDllNameSet = new HashSet<string>(PathComparer); 377var neededDllNameSet = new HashSet<string>(PathComparer);
OptProfCheckerUtil.cs (2)
75var manifestFileNames = GetManifestFileNames(textWriter, vsixFullPath); 99private static HashSet<string> GetManifestFileNames(TextWriter textWriter, string vsixFullPath)
SolutionCheckerUtil.cs (1)
148var set = new HashSet<string>();
BuildValidator (1)
LocalReferenceResolver.cs (1)
45private 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 (2)
Program.cs (2)
268var fixableDiagnosticIds = new HashSet<string>(); 269var categories = new HashSet<string>();
illink (72)
ILLink.RoslynAnalyzer (4)
DataFlow\DynamicallyAccessedMembersBinder.cs (1)
378 static void GetAllOnType (ITypeSymbol type, bool declaredOnly, List<ISymbol> members, HashSet<ITypeSymbol> types)
DataFlow\LValueFlowCaptureProvider.cs (1)
61 var rvalueFlowCaptureIds = new HashSet<CaptureId> ();
ISymbolExtensions.cs (1)
82 HashSet<string> featureSet = new ();
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
79 var values = new HashSet<DynamicallyAccessedMemberTypes> (
ILLink.Tasks (6)
CreateRuntimeRootDescriptorFile.cs (5)
57 public HashSet<string> methods; 58 public HashSet<string> fields; 98 readonly HashSet<string> defineConstants = new HashSet<string> (StringComparer.Ordinal); 491 readonly HashSet<string> defineConstants; 497 public DefineTracker (HashSet<string> defineConstants, TaskLoggingHelper log, string filePath)
LinkTask.cs (1)
350 HashSet<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 (2)
Http2\Http2TestBase.cs (1)
133protected readonly HashSet<int> _abortedStreamIds = new HashSet<int>();
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
21private readonly HashSet<DiagnosticPoolBlock> _blocks;
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)
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 (10)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
Metrics.Legacy (10)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
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 (18)
CascadingValue.cs (1)
14private HashSet<ComponentState>? _subscribers; // Lazily instantiated
NavigationManager.cs (1)
412var 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 (9)
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)
21private readonly Dictionary<string, HashSet<(int ComponentId, int FrameIndex)>> _namedSubmitEventsByScopeQualifiedName = new(StringComparer.Ordinal); 33if (!_namedSubmitEventsByScopeQualifiedName.TryGetValue(handlerName, out var locationsForName) || locationsForName.Count == 0) 142var locationsForName = _namedSubmitEventsByScopeQualifiedName[scopeQualifiedName]; 165var locationsForName = GetOrAddNewToDictionary(_namedSubmitEventsByScopeQualifiedName, scopeQualifiedName);
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
23private 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)
563var canceledHandlerTaskIds = new HashSet<string>(); 607var 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)
Hosting\WebAssemblyHostConfiguration.cs (1)
94var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
HotReload\MetadataUpdateHandlerInvoker.cs (2)
215var visited = new HashSet<string>(StringComparer.Ordinal); 222static void Visit(Assembly[] assemblies, Assembly assembly, List<Assembly> sortedAssemblies, HashSet<string> visited)
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.Http.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)
28var validatableTypes = new HashSet<ValidatableType>(ValidatableTypeComparer.Instance); 37internal bool TryExtractValidatableType(ITypeSymbol incomingTypeSymbol, WellKnownTypes wellKnownTypes, ref HashSet<ValidatableType> validatableTypes, ref List<ITypeSymbol> visitedTypes) 95internal ImmutableArray<ValidatableProperty> ExtractValidatableMembers(ITypeSymbol typeSymbol, WellKnownTypes wellKnownTypes, ref HashSet<ValidatableType> validatableTypes, ref List<ITypeSymbol> visitedTypes)
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 (4)
Services\OpenApiDocumentService.cs (2)
338private static HashSet<OpenApiTagReference> GetTags(ApiDescription description, OpenApiDocument document) 343HashSet<OpenApiTagReference> tags = [];
Services\OpenApiGenerator.cs (2)
327private HashSet<OpenApiTagReference> GetOperationTags(MethodInfo methodInfo, EndpointMetadataCollection metadata) 334var 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)
12private readonly Dictionary<string, HashSet<string>> _taggedEntries = new(); 23internal Dictionary<string, HashSet<string>> TaggedEntries => _taggedEntries; 31if (_taggedEntries.TryGetValue(tag, out var keys)) 91if (!_taggedEntries.TryGetValue(tag, out var keys)) 144if (_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 (2)
MemoryOutputCacheStoreTests.cs (2)
74HashSet<string> tag1s; 180HashSet<string> tag1s, tag2s;
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)
21private 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)
21private 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 (7)
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\CertificateGeneration\UnixCertificateManager.cs (3)
40private HashSet<string>? _availableCommands; 500private static HashSet<string> FindAvailableCommands() 502var availableCommands = new HashSet<string>();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
21private readonly HashSet<DiagnosticPoolBlock> _blocks;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
21private readonly HashSet<DiagnosticPoolBlock> _blocks;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
21private readonly HashSet<DiagnosticPoolBlock> _blocks;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
21private readonly HashSet<DiagnosticPoolBlock> _blocks;
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Shared\Buffers.MemoryPool\DiagnosticMemoryPool.cs (1)
21private 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 (140)
AssemblyNameExtension.cs (4)
67private HashSet<AssemblyNameExtension> remappedFrom; 170remappedFrom = (HashSet<AssemblyNameExtension>)info.GetValue("remapped", typeof(HashSet<AssemblyNameExtension>)); 229private static HashSet<AssemblyNameExtension> CreateRemappedFrom()
BackEnd\BuildManager\BuildManager.cs (7)
123private readonly HashSet<int> _activeNodes; 133private readonly Dictionary<int, HashSet<int>> _nodeIdToKnownConfigurations; 304_nodeIdToKnownConfigurations = new Dictionary<int, HashSet<int>>(); 2055var blockedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes); 2056var finishedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes.Count); 2456if (!_nodeIdToKnownConfigurations.TryGetValue(node, out HashSet<int>? configurationsOnNode)) 2722if (!_nodeIdToKnownConfigurations.TryGetValue(response.NodeId, out HashSet<int>? configurationsOnNode) ||
BackEnd\BuildManager\BuildParameters.cs (1)
566/// A list of warnings to treat as errors. To treat all warnings as errors, set this to an empty <see cref="HashSet{String}"/>.
BackEnd\BuildManager\CacheAggregator.cs (1)
68var seenConfigIds = new HashSet<int>();
BackEnd\BuildManager\RequestedProjectState.cs (2)
75HashSet<string> anotherPropertyFilters = new HashSet<string>(another.PropertyFilters); 112HashSet<string> anotherMetadata = new HashSet<string>(metadata);
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1138HashSet<int> unresolvedConfigurationsAdded = null;
BackEnd\Components\Communications\NodeInfo.cs (1)
31private HashSet<int> _configurationIDs;
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
103private HashSet<int> _activeNodes;
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
37private static readonly HashSet<string> s_projectSpecificPropertyNames = new(StringComparer.OrdinalIgnoreCase) { "TargetFramework", "Configuration", "Platform", "TargetPlatform", "OutputType" }; 524HashSet<ProjectCacheDescriptor> queriedCaches = new(ProjectCacheDescriptorEqualityComparer.Instance);
BackEnd\Components\RequestBuilder\BatchingEngine.cs (2)
121HashSet<string> consumedItemReferences = pair.Items; 209HashSet<string> consumedItemReferenceNames,
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (9)
79HashSet<string> keepMetadata = null; 80HashSet<string> removeMetadata = null; 81HashSet<string> matchOnMetadata = null; 250private void ExecuteRemove(ProjectItemGroupTaskItemInstance child, ItemBucket bucket, HashSet<string> matchOnMetadata, MatchOnMetadataOptions matchingOptions) 476var excludesUnescapedForComparison = EvaluateExcludePaths(excludes, originalItem.ExcludeLocation); 518private HashSet<string> EvaluateExcludePaths(IReadOnlyList<string> excludes, ElementLocation excludeLocation) 520HashSet<string> excludesUnescapedForComparison = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 559HashSet<string> specificationsToFind = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 618HashSet<string> matchOnMetadata,
BackEnd\Components\RequestBuilder\Lookup.cs (1)
676var existingItemsHashSet = existingItems.ToHashSet(ProjectItemInstance.EqualityComparer);
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
799HashSet<string> targetsChecked = null;
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
652HashSet<TaskItem> addedItems = new HashSet<TaskItem>();
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
1039var declaredProjects = new HashSet<string>(projectReferenceItems.Count + 1, FileUtilities.PathComparer);
BackEnd\Components\Scheduler\SchedulableRequest.cs (2)
102private HashSet<SchedulableRequest> _requestsWeAreBlocking; 526HashSet<SchedulableRequest> evaluatedRequests = new HashSet<SchedulableRequest>();
BackEnd\Components\Scheduler\Scheduler.cs (19)
238internal delegate void AssignUnscheduledRequestsDelegate(List<ScheduleResponse> responses, HashSet<int> idleNodes); 701HashSet<int> idleNodes = new HashSet<int>(); 794private void AssignUnscheduledRequestsToNodes(List<ScheduleResponse> responses, HashSet<int> idleNodes) 920private void AssignUnscheduledRequestsWithPlanByMostImmediateReferences(List<ScheduleResponse> responses, HashSet<int> idleNodes) 928private void AssignUnscheduledRequestsWithPlanByGreatestPlanTime(List<ScheduleResponse> responses, HashSet<int> idleNodes) 933private void AssignUnscheduledRequestsWithPlan(List<ScheduleResponse> responses, HashSet<int> idleNodes, Func<SchedulingPlan.PlanConfigData, SchedulingPlan.PlanConfigData, bool> comparisonFunction) 976private void AssignUnscheduledRequestsByTraversalsFirst(List<ScheduleResponse> responses, HashSet<int> idleNodes) 985private void AssignUnscheduledProxyBuildRequestsToInProcNode(List<ScheduleResponse> responses, HashSet<int> idleNodes) 990private void AssignUnscheduledRequestsToInProcNode(List<ScheduleResponse> responses, HashSet<int> idleNodes, Func<SchedulableRequest, bool> shouldBeScheduled) 1018private void AssignUnscheduledRequestsWithConfigurationCountLevelling(List<ScheduleResponse> responses, HashSet<int> idleNodes) 1057private void AssignUnscheduledRequestsWithSmallestFileSize(List<ScheduleResponse> responses, HashSet<int> idleNodes) 1099private void AssignUnscheduledRequestsWithLargestFileSize(List<ScheduleResponse> responses, HashSet<int> idleNodes) 1141private void AssignUnscheduledRequestsWithMaxWaitingRequests(List<ScheduleResponse> responses, HashSet<int> idleNodes) 1218private void AssignUnscheduledRequestsWithMaxWaitingRequests2(List<ScheduleResponse> responses, HashSet<int> idleNodes) 1246private void AssignUnscheduledRequestsFIFO(List<ScheduleResponse> responses, HashSet<int> idleNodes) 1278private void AssignUnscheduledRequestsUsingCustomSchedulerForSQL(List<ScheduleResponse> responses, HashSet<int> idleNodes) 2294HashSet<int>[] runningRequests = new HashSet<int>[currentWork.Length]; 2633HashSet<SchedulableRequest> topLevelBlockingRequests = new HashSet<SchedulableRequest>();
BackEnd\Components\Scheduler\SchedulingData.cs (18)
59private readonly Dictionary<int, HashSet<SchedulableRequest>> _scheduledRequestsByNode = new Dictionary<int, HashSet<SchedulableRequest>>(32); 69private readonly Dictionary<int, HashSet<SchedulableRequest>> _readyRequestsByNode = new Dictionary<int, HashSet<SchedulableRequest>>(32); 74private readonly Dictionary<int, HashSet<int>> _configurationsByNode = new Dictionary<int, HashSet<int>>(32); 87private readonly Dictionary<int, HashSet<SchedulableRequest>> _configurationToRequests = new Dictionary<int, HashSet<SchedulableRequest>>(32); 276HashSet<SchedulableRequest> requests; 338HashSet<SchedulableRequest> requestsAssignedToNode; 349HashSet<int> configurationsAssignedToNode; 382if (_scheduledRequestsByNode.TryGetValue(request.AssignedNode, out var requests)) 407HashSet<SchedulableRequest> readyRequestsOnNode; 439HashSet<SchedulableRequest> requests; 527HashSet<int> configurationsAssignedToNode; 570HashSet<SchedulableRequest> requests; 584HashSet<SchedulableRequest> requests; 598HashSet<SchedulableRequest> requests;
BackEnd\Components\Scheduler\SchedulingPlan.cs (2)
502private HashSet<PlanConfigData> _references = new HashSet<PlanConfigData>(); 507private HashSet<PlanConfigData> _referrers = new HashSet<PlanConfigData>();
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (1)
150HashSet<DirectoryInfo> overrideFolders = resolversDirInfo.GetDirectories().ToHashSet(new DirInfoNameComparer());
BackEnd\Shared\BuildRequestConfiguration.cs (3)
113private HashSet<string> _projectTargets; 568internal HashSet<string> ProjectTargets 1042private HashSet<string> GetProjectTargets(IDictionary<string, ProjectTargetInstance> projectTargets) => projectTargets.Keys.ToHashSet();
BackEnd\Shared\BuildResult.cs (3)
120private static readonly HashSet<string> s_additionalEntriesKeys = new HashSet<string> { SpecialKeyForVersion }; 148private HashSet<string>? _projectTargets; 488internal HashSet<string>? ProjectTargets
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
37private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\EmbeddedResourceCheck.cs (1)
36private readonly HashSet<string> _projects = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\NoEnvironmentVariablePropertyCheck.cs (1)
29private readonly HashSet<EnvironmentVariableIdentityKey> _environmentVariablesCache = new HashSet<EnvironmentVariableIdentityKey>();
BuildCheck\Checks\PreferProjectReferenceCheck.cs (1)
39private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\PropertiesUsageCheck.cs (1)
122private HashSet<string> _readProperties = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\SharedOutputPathCheck.cs (1)
37private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\TargetFrameworkConfusionCheck.cs (1)
35private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\TargetFrameworkUnexpectedCheck.cs (1)
37private readonly HashSet<string> _projectsSeen = new(MSBuildNameIgnoreCaseComparer.Default);
BuildCheck\Checks\UntrustedLocationCheck.cs (1)
37private HashSet<string> checkedProjects = new HashSet<string>();
BuildCheck\Infrastructure\BuildCheckForwardingLogger.cs (1)
32private HashSet<Type> _eventsToForward =
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (3)
445if (_deferredProjectEvalIdToImportedProjects.TryGetValue(checkContext.BuildEventContext.EvaluationId, out HashSet<string>? importedProjects)) 546private readonly Dictionary<int, HashSet<string>> _deferredProjectEvalIdToImportedProjects = new(); 671out HashSet<string>? importedProjects))
Construction\Solution\SolutionFile.cs (3)
104private HashSet<string> _solutionFilter; // The project files to include in loading the solution. 828var projectsByOriginalName = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 907HashSet<string> projectPaths = new HashSet<string>(_projectsInOrder.Count, _pathComparer);
Evaluation\Expander.cs (1)
2689HashSet<string> seenItems = new HashSet<string>(comparer);
Evaluation\ItemsAndMetadataPair.cs (3)
18private HashSet<string> _items; 32internal ItemsAndMetadataPair(HashSet<string> items, Dictionary<string, MetadataReference> metadata) 41internal HashSet<string> Items
Evaluation\LazyItemEvaluator.OrderedItemDataCollection.cs (1)
149HashSet<I> itemsToRemove = null;
Evaluation\LazyItemEvaluator.RemoveOperation.cs (1)
74HashSet<I> items = null;
Evaluation\ProjectParser.cs (11)
31private static readonly HashSet<string> ValidAttributesOnlyConditionAndLabel = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label }; 36private static readonly HashSet<string> KnownAttributesOnItem = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.include, XMakeAttributes.exclude, XMakeAttributes.remove, XMakeAttributes.keepMetadata, XMakeAttributes.removeMetadata, XMakeAttributes.keepDuplicates, XMakeAttributes.update, XMakeAttributes.matchOnMetadata, XMakeAttributes.matchOnMetadataOptions }; 41private static readonly HashSet<string> KnownAttributesOnItemIgnoreCase = new HashSet<string>(KnownAttributesOnItem, StringComparer.OrdinalIgnoreCase); 46private static readonly HashSet<string> ValidAttributesOnImport = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.project, XMakeAttributes.sdk, XMakeAttributes.sdkVersion, XMakeAttributes.sdkMinimumVersion }; 51private static readonly HashSet<string> ValidAttributesOnUsingTask = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.taskName, XMakeAttributes.assemblyFile, XMakeAttributes.assemblyName, XMakeAttributes.taskFactory, XMakeAttributes.architecture, XMakeAttributes.runtime, XMakeAttributes.requiredPlatform, XMakeAttributes.requiredRuntime, XMakeAttributes.overrideUsingTask }; 56private static readonly HashSet<string> ValidAttributesOnTarget = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.name, XMakeAttributes.inputs, XMakeAttributes.outputs, XMakeAttributes.keepDuplicateOutputs, XMakeAttributes.dependsOnTargets, XMakeAttributes.beforeTargets, XMakeAttributes.afterTargets, XMakeAttributes.returns }; 61private static readonly HashSet<string> ValidAttributesOnOnError = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.executeTargets }; 66private static readonly HashSet<string> ValidAttributesOnOutput = new HashSet<string> { XMakeAttributes.condition, XMakeAttributes.label, XMakeAttributes.taskParameter, XMakeAttributes.itemName, XMakeAttributes.propertyName }; 71private static readonly HashSet<string> ValidAttributesOnUsingTaskParameter = new HashSet<string> { XMakeAttributes.parameterType, XMakeAttributes.output, XMakeAttributes.required }; 76private static readonly HashSet<string> ValidAttributesOnUsingTaskBody = new HashSet<string> { XMakeAttributes.evaluate }; 482HashSet<String> listOfChildElementNames = new HashSet<string>();
Evaluation\PropertyTrackingEvaluatorDataWrapper.cs (1)
34private readonly HashSet<string> _overwrittenEnvironmentVariables = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
FileMatcher.cs (1)
2395HashSet<string>? resultsToExclude = null;
Graph\GraphBuilder.cs (3)
136Dictionary<ProjectGraphNode, HashSet<ProjectGraphNode>> transitiveReferenceCache = new(allParsedProjects.Count); 171HashSet<ProjectGraphNode> GetTransitiveProjectReferencesExcludingSelf(ParsedProject parsedProject) 173if (transitiveReferenceCache.TryGetValue(parsedProject.GraphNode, out HashSet<ProjectGraphNode> transitiveReferences))
Graph\ProjectGraph.cs (1)
616var encounteredEdges = new HashSet<ProjectGraphBuildRequest>();
Graph\ProjectGraphNode.cs (2)
21private readonly HashSet<ProjectGraphNode> _projectReferences = new HashSet<ProjectGraphNode>(); 22private readonly HashSet<ProjectGraphNode> _referencingProjects = new HashSet<ProjectGraphNode>();
Instance\ProjectInstance.cs (2)
2448var globalPropertiesToTreatAsLocal = (HashSet<string>)_globalPropertiesToTreatAsLocal;
Instance\ProjectItemInstance.cs (1)
1631var thisNames = new HashSet<string>(capacity, MSBuildNameIgnoreCaseComparer.Default);
Logging\BinaryLogger\ProjectImportsCollector.cs (1)
34private readonly HashSet<string> _processedFiles = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
PlatformNegotiation.cs (1)
36HashSet<string> projectReferencePlatforms = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Resources\Constants.cs (1)
67private static readonly HashSet<string> ReservedProperties = new HashSet<string>(MSBuildNameIgnoreCaseComparer.Default)
TranslatorHelpers.cs (2)
177ref HashSet<T> hashSet, 179NodePacketCollectionCreator<HashSet<T>> collectionFactory) where T : class, ITranslatable
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
XMakeElements.cs (1)
48internal static readonly HashSet<string> ReservedItemNames =
Xml\ProjectXmlUtilities.cs (1)
182internal static void VerifyThrowProjectAttributes(XmlElementWithLocation element, HashSet<string> validAttributes)
Microsoft.Build.BuildCheck.UnitTests (1)
EditorConfig_Tests.cs (1)
694var expectedSet = new HashSet<T>(expected, comparer);
Microsoft.Build.Engine.OM.UnitTests (7)
ObjectModelRemoting\Helpers\TestCollectionGroup.cs (3)
200private IReadOnlyDictionary<ProjectCollectionLinker, HashSet<Project>> ImmutableProjects { get; set; } 205var result = new Dictionary<ProjectCollectionLinker, HashSet<Project>>(); 245HashSet<Project> toKeep = null;
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (1)
473HashSet<Project> remotes = new HashSet<Project>();
ObjectModelRemoting\RemoteProjectsProviderMock\ExporterMock.cs (3)
237HashSet<object> views = new HashSet<object>(); 238HashSet<object> links = new HashSet<object>(); 239HashSet<object> remoters = new HashSet<object>();
Microsoft.Build.Engine.UnitTests (26)
BackEnd\BinaryTranslator_Tests.cs (4)
1184HashSet<BaseClass> values = new() 1192HashSet<BaseClass> deserializedValues = null; 1201HashSet<BaseClass> value = null; 1204HashSet<BaseClass> deserializedValue = null;
BackEnd\LoggingService_Tests.cs (8)
726HashSet<string> warningsAsErrors = new HashSet<string> 758HashSet<string> warningsAsErrors = new HashSet<string> 781HashSet<string> warningsAsErrors = new HashSet<string>(); 810HashSet<string> warningsAsMessages = new HashSet<string> 843HashSet<string> warningsAsMessages = new HashSet<string> 864HashSet<string> warningsAsErrorsForProject = new HashSet<string> 900HashSet<string> warningsAsErrorsForProject = new HashSet<string>(); 917HashSet<string> warningsAsMessagesForProject = new HashSet<string>
BackEnd\TaskHostConfiguration_Tests.cs (3)
293HashSet<string> WarningsAsErrors = new HashSet<string>(); 633HashSet<string> WarningsAsErrors = new HashSet<string>(); 683HashSet<string> WarningsAsMessages = new HashSet<string>();
Definition\ProjectEvaluationContext_Tests.cs (2)
237var seenContexts = new HashSet<EvaluationContext>(); 305var seenContexts = new HashSet<EvaluationContext>();
Evaluation\Evaluator_Tests.cs (1)
2255HashSet<string> allProjectPropertiesNoDuplicateNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Evaluation\ExpressionShredder_Tests.cs (6)
458HashSet<string> actualItems = pair.Items; 461HashSet<string> expectedItems = GetConsumedItemReferences_OriginalImplementation(test); 472private static void VerifyAgainstCanonicalResults(string test, HashSet<string> actual, HashSet<string> expected) 1122private static HashSet<string> GetConsumedItemReferences_OriginalImplementation(string expression) 1124HashSet<string> result = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Graph\GraphLoadedFromSolution_tests.cs (1)
528HashSet<string> propertiesToIgnore = new(StringComparer.OrdinalIgnoreCase)
Graph\ProjectGraph_Tests.cs (1)
2108var referenceNumbersSet = innerBuildWithCommonReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
Microsoft.Build.Framework (19)
BinaryTranslator.cs (4)
298public void Translate(ref HashSet<string> set) 600public void TranslateDictionary(ref Dictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys) 1102public void Translate(ref HashSet<string> set) 1382public void TranslateDictionary(ref Dictionary<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 Dictionary<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.Build.Tasks.Core (55)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigCache.cs (1)
22private readonly HashSet<string> _filesInDirectories;
AssemblyDependency\Reference.cs (5)
32private HashSet<Reference> _dependees = new HashSet<Reference>(); 38private HashSet<Reference> _dependencies = new HashSet<Reference>(); 123private HashSet<AssemblyRemapping> _remappedAssemblyNames = new HashSet<AssemblyRemapping>(); 248internal HashSet<Reference> GetDependees() 718internal HashSet<AssemblyRemapping> RemappedAssemblyNames()
AssemblyDependency\ReferenceTable.cs (4)
41private readonly HashSet<string> _externallyResolvedPrimaryReferences = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 1239var parentReferencesAdded = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 1870var conflictingFullNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 2051var seenFrameworkDirectories = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
AssemblyFoldersEx.cs (1)
54private HashSet<string> _uniqueDirectoryPaths = new HashSet<string>();
AssemblyNameExtension.cs (4)
67private HashSet<AssemblyNameExtension> remappedFrom; 170remappedFrom = (HashSet<AssemblyNameExtension>)info.GetValue("remapped", typeof(HashSet<AssemblyNameExtension>)); 229private static HashSet<AssemblyNameExtension> CreateRemappedFrom()
BootstrapperUtil\BootstrapperBuilder.cs (1)
427var folders = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Delete.cs (1)
107var deletedFilesSet = new HashSet<string>(FileUtilities.PathComparer);
FileMatcher.cs (1)
2395HashSet<string>? resultsToExclude = null;
GenerateResource.cs (1)
1467HashSet<string> set = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
GetSDKReferenceFiles.cs (6)
39private readonly HashSet<ResolvedReferenceAssembly> _resolvedReferences = new HashSet<ResolvedReferenceAssembly>(); 44private readonly HashSet<ResolvedRedistFile> _resolveRedistFiles = new HashSet<ResolvedRedistFile>(); 304var resolvedRedistFileSet = new HashSet<ResolvedRedistFile>(); 368var resolvedReferenceAssemblies = new HashSet<ResolvedReferenceAssembly>(); 568private void GatherReferenceAssemblies(HashSet<ResolvedReferenceAssembly> resolvedFiles, ITaskItem sdkReference, string path, SDKInfo info) 614private void GatherRedistFiles(HashSet<ResolvedRedistFile> resolvedRedistFiles, ITaskItem sdkReference, string redistFilePath, SDKInfo info)
ListOperators\RemoveDuplicates.cs (1)
48var alreadySeen = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
MakeDir.cs (1)
46var directoriesSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
PlatformNegotiation.cs (1)
36HashSet<string> projectReferencePlatforms = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ResolveProjectBase.cs (1)
42private readonly HashSet<string> _cachedProjectReferencesByAbsolutePath = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
ResolveSDKReference.cs (15)
315var sdkNamesOnReferenceItems = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 329var sdkReferenceItems = new HashSet<SDKReference>(); 332var productFamilyNameToSDK = new Dictionary<string, HashSet<SDKReference>>(StringComparer.OrdinalIgnoreCase); 335var sdkNameToSDK = new Dictionary<string, HashSet<SDKReference>>(StringComparer.OrdinalIgnoreCase); 338var sdksNotCompatibleWithOtherSDKs = new HashSet<SDKReference>(); 363if (!productFamilyNameToSDK.TryGetValue(reference.ProductFamilyName, out HashSet<SDKReference> sdksWithProductFamilyName)) 378if (!sdkNameToSDK.TryGetValue(reference.SimpleName, out HashSet<SDKReference> sdksWithSimpleName)) 403var sdksAlreadyErrorOrWarnedFor = new HashSet<SDKReference>(); 408if (productFamilyNameToSDK.TryGetValue(notCompatibleReference.ProductFamilyName, out HashSet<SDKReference> referenceInProductFamily)) 437if (sdkNameToSDK.TryGetValue(notCompatibleReference.SimpleName, out HashSet<SDKReference> referenceWithSameName)) 479internal static void AddMetadataToReferences(TaskLoggingHelper log, HashSet<SDKReference> sdkReferenceItems, Dictionary<string, string> referencesToAddMetadata, string metadataName, string metadataValue) 499internal static void VerifySDKDependsOn(TaskLoggingHelper log, HashSet<SDKReference> sdkReferenceItems) 523internal static string[] GetUnresolvedDependentSDKs(HashSet<SDKReference> sdkReferenceItems, List<string> dependentSDKs) 912public void Resolve(Dictionary<string, ITaskItem> sdks, string targetConfiguration, string targetArchitecture, HashSet<string> sdkNamesOnReferenceItems, bool treatErrorsAsWarnings, bool prefer32Bit, string identifierTargetPlatform, Version versionTargetPlatform, string projectName, bool enableMaxPlatformVersionEmptyWarning) 1171private void CreateResolvedReferenceItem(string targetConfiguration, string targetArchitecture, HashSet<string> sdkNamesOnReferenceItems, string targetPlatformIdentifier, Version targetPlatformVersion, Version targetPlatformVersionFromItem, string projectName, bool enableMaxPlatformVersionEmptyWarning)
SystemState.cs (1)
569HashSet<string> assembliesFound = new HashSet<string>();
Touch.cs (1)
90var touchedFilesSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
TranslatorHelpers.cs (2)
177ref HashSet<T> hashSet, 179NodePacketCollectionCreator<HashSet<T>> collectionFactory) where T : class, ITranslatable
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
XMakeElements.cs (1)
48internal static readonly HashSet<string> ReservedItemNames =
Microsoft.Build.Tasks.UnitTests (4)
ResolveSDKReference_Tests.cs (4)
95HashSet<SDKReference> resolvedSDKsEmpty = new HashSet<SDKReference>(); 98HashSet<SDKReference> resolvedSDKs = new HashSet<SDKReference>() { new SDKReference(new TaskItem(), "bar", "1.0"), new SDKReference(new TaskItem(), "foo", "1.0"), new SDKReference(new TaskItem(), "Newt", "1.0") }; 318HashSet<SDKReference> references = new HashSet<SDKReference>(); 359HashSet<SDKReference> references = new HashSet<SDKReference>();
Microsoft.Build.Utilities.Core (3)
AssemblyFoldersEx.cs (1)
54private HashSet<string> _uniqueDirectoryPaths = new HashSet<string>();
FileMatcher.cs (1)
2395HashSet<string>? resultsToExclude = null;
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, 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 (102)
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)
837var refSet = new HashSet<MetadataReference>(this.ExternalReferences); 1883internal bool FilterAndAppendDiagnostics(DiagnosticBag accumulator, IEnumerable<Diagnostic> incoming, HashSet<int>? exclude, CancellationToken cancellationToken) 2138var uniqueResourceNames = new HashSet<string>(); 2142var uniqueFileNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
DiagnosticAnalyzer\AnalysisResultBuilder.cs (13)
29private readonly HashSet<DiagnosticAnalyzer> _completedAnalyzersForCompilation; 30private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByTree; 31private readonly Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>> _completedSemanticAnalyzersByTree; 32private readonly Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>> _completedSyntaxAnalyzersByAdditionalFile; 45_completedSyntaxAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 46_completedSemanticAnalyzersByTree = new Dictionary<SyntaxTree, HashSet<DiagnosticAnalyzer>>(); 47_completedSyntaxAnalyzersByAdditionalFile = new Dictionary<AdditionalText, HashSet<DiagnosticAnalyzer>>(); 104private HashSet<DiagnosticAnalyzer>? GetCompletedAnalyzersForFile_NoLock(SourceOrAdditionalFile filterFile, bool syntax) 109if (completedAnalyzersByTree.TryGetValue(tree, out var completedAnalyzersForTree)) 116if (_completedSyntaxAnalyzersByAdditionalFile.TryGetValue(additionalFile, out var completedAnalyzersForFile)) 131var completedAnalyzers = new HashSet<DiagnosticAnalyzer> { analyzer }; 165var completedAnalyzersForFile = filterScope.HasValue 217var 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)
2866HashSet<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)
596private HashSet<string> _namesOfTopLevelTypes; 660HashSet<string> names; 711static 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)
415HashSet<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\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
16/// 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)
24private readonly HashSet<GreenNode> _nodeSimilaritySet = new HashSet<GreenNode>(); 25private 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 (19)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (6)
154private readonly Dictionary<INamedTypeSymbol, HashSet<IInvocationOperation>> _codeActionCreateInvocations = []; 159private readonly Dictionary<INamedTypeSymbol, HashSet<IObjectCreationOperation>> _codeActionObjectCreations = []; 201private static void AddOperation<T>(INamedTypeSymbol namedType, T operation, Dictionary<INamedTypeSymbol, HashSet<T>> map) 206if (!map.TryGetValue(namedType, out HashSet<T> value)) 277&& _codeActionCreateInvocations.TryGetValue(fixer, out HashSet<IInvocationOperation> invocations)) 290&& _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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
Microsoft.CodeAnalysis.AnalyzerUtilities (36)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
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)
65protected 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)
128protected override void AddTrackedEntities(PointsToAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (11)
58protected override void AddTrackedEntities(TaintedDataAnalysisData analysisData, HashSet<AnalysisEntity> builder, bool forInterproceduralAnalysis) 481HashSet<SymbolAccess>? sourceOrigins = null; 569if (IsMethodArgumentASink(targetMethod, infosForType, taintedArgument, out HashSet<SinkKind>? sinkKinds)) 604if (this.IsPropertyASink(propertyReferenceOperation, out HashSet<SinkKind>? sinkKinds)) 682private static bool IsMethodArgumentASink(IMethodSymbol method, IEnumerable<SinkInfo> infosForType, IArgumentOperation taintedArgument, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 685Lazy<HashSet<SinkKind>> lazySinkKinds = new Lazy<HashSet<SinkKind>>(() => []); 722/// <param name="sinkKinds">If the property is a sink, <see cref="HashSet{SinkInfo}"/> containing the kinds of sinks; null otherwise.</param> 724private bool IsPropertyASink(IPropertyReferenceOperation propertyReferenceOperation, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 726Lazy<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)
47private readonly HashSet<IArgumentOperation> _pendingArgumentsToReset; 49private readonly HashSet<IOperation> _visitedFlowBranchConditions; 50private readonly HashSet<IFlowAnonymousFunctionOperation> _visitedLambdas; 51private 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))
Microsoft.CodeAnalysis.BannedApiAnalyzers (10)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
Microsoft.CodeAnalysis.CodeStyle (69)
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 (10)
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); 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)
142static 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\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
16/// 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\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
20private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
100private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 102HashSet<INamedTypeSymbol>? symbols = null)
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\FixedSizeArrayBuilder.cs (1)
64public void AddRange(HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
Microsoft.CodeAnalysis.CodeStyle.Fixes (19)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
439var 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)
25protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 30var 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\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 (6)
Extensions\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
Internal\InsertionBehavior.cs (1)
16/// Used internally to control behavior of insertion into a <see cref="Dictionary{TKey, TValue}"/> or <see cref="HashSet{T}"/>.
Microsoft.CodeAnalysis.CSharp (273)
Binder\Binder.CapturedParametersFinder.cs (2)
19private readonly HashSet<string> _namesToCheck; 22private CapturedParametersFinder(SynthesizedPrimaryConstructor primaryConstructor, HashSet<string> namesToCheck, ArrayBuilder<ParameterSymbol> captured)
Binder\Binder.ValueChecks.cs (2)
1956var previousVisited = _visited; 5717var 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) 6104private static void ReportDuplicateObjectMemberInitializers(BoundExpression boundMemberInitializer, HashSet<string> memberNameMap, BindingDiagnosticBag diagnostics)
Binder\Binder_Lookup.cs (5)
979var allMembers = new HashSet<Symbol>(comparer); 980var conflictingMembers = new HashSet<Symbol>(comparer); 1159var visited = new HashSet<NamedTypeSymbol>(Symbols.SymbolEqualityComparer.ConsiderEverything); 1175static void addAllInterfaces(NamedTypeSymbol @interface, HashSet<NamedTypeSymbol> visited, ArrayBuilder<NamedTypeSymbol> result, ConsList<TypeSymbol> basesBeingResolved, ConsList<NamedTypeSymbol> cycleGuard) 1216HashSet<NamedTypeSymbol> seenInterfaces = null;
Binder\Binder_Operators.cs (1)
2693var existing = new HashSet<MethodSymbol>(PairedOperatorComparer.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\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; 2971var parseOptionsReported = new HashSet<ParseOptions>(); 4885var result = new HashSet<Symbol>(); 4897HashSet<Symbol> set) 4951ArrayBuilder<MergedNamespaceOrTypeDeclaration> spine, MergedTypeDeclaration current, HashSet<Symbol> set)
Compilation\CSharpSemanticModel.cs (1)
4212HashSet<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)
215var 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)
969HashSet<NamedTypeSymbol> seen = null; 980private static void InterfacesVisit(NamedTypeSymbol namedType, ArrayBuilder<NamedTypeSymbol> builder, ref HashSet<NamedTypeSymbol> seen)
Emitter\Model\PEModuleBuilder.cs (3)
654internal static HashSet<NamedTypeSymbol> GetForwardedTypes(SourceAssemblySymbol sourceAssembly, ArrayBuilder<Cci.ExportedType>? builder) 656var seenTopLevelForwardedTypes = new HashSet<NamedTypeSymbol>(); 736HashSet<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)
25private 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)
59private readonly HashSet<Symbol>? initiallyAssignedVariables; 131private readonly HashSet<PrefixUnaryExpressionSyntax>? _unassignedVariableAddressOfSyntaxes; 172HashSet<PrefixUnaryExpressionSyntax>? unassignedVariableAddressOfSyntaxes = null, 197HashSet<Symbol>? initiallyAssignedVariables = null) 219HashSet<Symbol> initiallyAssignedVariables, 220HashSet<PrefixUnaryExpressionSyntax> unassignedVariableAddressOfSyntaxes, 592HashSet<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)
30var result = walker._entryPoints; 40private 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)
37private 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)
465internal 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)
899HashSet<TypeParameterSymbol> ignoreTypeConstraintsDependentOnTypeParametersOpt = null) 1052HashSet<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)
185internal 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)
156internal 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)
970HashSet<TypeSymbol> unificationCheckedTypes = null;
Symbols\NamedTypeSymbol.cs (2)
1425HashSet<TypeSymbol> unificationCheckedTypes = null; 1452internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\PointerTypeSymbol.cs (1)
296internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\PropertyOrEventSymbolExtensions.cs (1)
45var 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)
64HashSet<SourceFieldSymbolWithSyntaxReference> dependencies,
Symbols\Source\LambdaSymbol.cs (1)
28private readonly HashSet<AssemblySymbol> _declarationDependencies;
Symbols\Source\LocalFunctionSymbol.cs (1)
36private readonly HashSet<AssemblySymbol> _declarationDependencies;
Symbols\Source\SourceAssemblySymbol.cs (13)
992var knownModuleNames = new HashSet<String>(StringComparer.OrdinalIgnoreCase); 1188private HashSet<CSharpAttributeData> GetUniqueSourceAssemblyAttributes() 1192HashSet<CSharpAttributeData> uniqueAttributes = null; 1209private static bool AddUniqueAssemblyAttribute(CSharpAttributeData attribute, ref HashSet<CSharpAttributeData> uniqueAttributes) 1221private bool ValidateAttributeUsageForNetModuleAttribute(CSharpAttributeData attribute, string netModuleName, BindingDiagnosticBag diagnostics, ref HashSet<CSharpAttributeData> uniqueAttributes) 1325HashSet<CSharpAttributeData> uniqueAttributes = GetUniqueSourceAssemblyAttributes(); 1384var unused = GetUniqueSourceAssemblyAttributes(); 1388HashSet<NamedTypeSymbol> forwardedTypes = null; 1492HashSet<CSharpAttributeData> uniqueAttributes = null; 1708internal HashSet<NamedTypeSymbol> GetForwardedTypes() 2252HashSet<NamedTypeSymbol> forwardedTypes = assemblyData.ForwardedTypes; 2687HashSet<FieldSymbol> handledUnreadFields = null; 2829HashSet<NamedTypeSymbol> forwardedTypes = GetForwardedTypes();
Symbols\Source\SourceEnumConstantSymbol.cs (3)
154protected override ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics) 172protected override ConstantValue MakeConstantValue(HashSet<SourceFieldSymbolWithSyntaxReference> dependencies, bool earlyDecodingWellKnownAttributes, BindingDiagnosticBag diagnostics) 201protected 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)
1980var conversionsAsConversions = new HashSet<MethodSymbol>(ConversionSignatureComparer.Comparer);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
633protected 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)
1330internal static bool GetUnificationUseSiteDiagnosticRecursive<T>(ref DiagnosticInfo result, ImmutableArray<T> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) where T : TypeSymbol 1343internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1356internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<CustomModifier> modifiers, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1369internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<ParameterSymbol> parameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1383internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeParameterSymbol> typeParameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\Symbol_Attributes.cs (3)
485var toRemove = new HashSet<Diagnostic>(ReferenceEqualityComparer.Instance); 850HashSet<NamedTypeSymbol> uniqueAttributeTypes = new HashSet<NamedTypeSymbol>(); 891HashSet<NamedTypeSymbol> uniqueAttributeTypes)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
199var 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)
647internal 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)
1218public static bool ContainsTypeParameters(this TypeSymbol type, HashSet<TypeParameterSymbol> parameters) 1224private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_containsTypeParametersPredicate = 1540public 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 (9)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
55var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>();
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)
48nameof(HashSet<int>),
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 (12)
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)
59var accessorLists = new HashSet<AccessorListSyntax>(); 77HashSet<AccessorListSyntax> accessorLists,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
62var 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.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
75var actualFolderPaths = new HashSet<string>();
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (1)
1421var hashset = new HashSet<string>(expectedTypesInRelativeOrder);
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
39var symbolKindsWithNoCodeBlocks = new HashSet<SymbolKind> 45var missingSyntaxNodes = new HashSet<SyntaxKind>
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (1)
572private 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 (37)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
100private (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)
956public HashSet<string> IdentifierNames { get; private set; }
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
54protected 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 (1)
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)
61Solution solution, SyntaxTree tree, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken) 133SemanticModel semanticModel, HashSet<INamedTypeSymbol> types, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
55var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>();
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)
48nameof(HashSet<int>),
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)
59var accessorLists = new HashSet<AccessorListSyntax>(); 77HashSet<AccessorListSyntax> accessorLists,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
62var 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)
69var 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)
157886var reportedDiagnostics = new HashSet<Diagnostic>();
Semantics\OperatorTests.cs (1)
8083HashSet<DiagnosticInfo> useSiteDiagnostics = null;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (18)
Compilation\CompilationAPITests.cs (2)
518var hs = new HashSet<MetadataReference> { ref1, ref2, ref3 }; 845var 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)
175HashSet<DiagnosticInfo> useSiteDiagnostics = null; 316HashSet<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 (9)
Rename\CSharpRenameRewriterLanguageService.cs (2)
67private readonly HashSet<SyntaxToken> _annotatedIdentifierTokens = []; 68private 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)
35private 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.Rewriter.cs (1)
134var result = new HashSet<UsingDirectiveSyntax>();
Microsoft.CodeAnalysis.EditorFeatures (16)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
43private 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)
216var 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)
52private readonly ObjectPool<HashSet<TagSpan<TTag>>> _tagSpanSetPool; 156_tagSpanSetPool = new ObjectPool<HashSet<TagSpan<TTag>>>(() => new HashSet<TagSpan<TTag>>(this), trimOnFree: false);
Workspaces\AbstractTextBufferVisibilityTracker.cs (1)
135public readonly HashSet<ITextView> TextViews = [];
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Classification\AbstractClassifierTests.cs (1)
294var classificationsSpans = new HashSet<TextSpan>();
Rename\RenamerTests.cs (1)
50var remainingErrors = new HashSet<string>(expectedErrors ?? []);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeFixes\CodeFixServiceTests.cs (2)
114var uniqueTitles = new HashSet<string>(); 1187var 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 (5)
48var strings = new HashSet<string>(GenerateStrings(2000).Skip(500).Take(1000), comparer); 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)
20private readonly HashSet<ITypeParameterSymbol> _acceptableTypeParameters;
Microsoft.CodeAnalysis.Features (137)
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)
61var uniqueIdentities = new HashSet<AssemblyIdentity>();
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
78var 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\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (3)
99var insertionOnlyChanges = new HashSet<TextChange>(); 102var allAddedProjectReferences = new HashSet<ProjectReference>(); 103var allAddedMetaDataReferences = new HashSet<MetadataReference>();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
173void AddCorrespondingDirectives(SyntaxNode member, HashSet<SyntaxNode> directives) 261var 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\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)
38HashSet<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)
55[property: DataMember(Order = 4)] Dictionary<string, HashSet<string>> DiagnosticIdToProviderName,
Copilot\ICopilotChangeAnalysisService.cs (1)
256var diagnosticIdToProviderName = new Dictionary<string, HashSet<string>>();
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
213var 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)
76private readonly HashSet<ProjectId> _staleProjects = [];
EditAndContinue\DebuggingSession.cs (1)
90private readonly HashSet<Guid> _modulesPreparedForUpdate = [];
EditAndContinue\EditSessionTelemetry.cs (4)
39private readonly HashSet<(ushort, ushort, Guid)> _rudeEdits = []; 40private readonly HashSet<string> _emitErrorIds = []; 41private readonly HashSet<Guid> _projectsWithValidDelta = []; 42private 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 (3)
26HashSet<string> methodNamesOfInterest) 45private readonly HashSet<string> _methodNamesOfInterest = methodNamesOfInterest; 53private static HashSet<string> GetMethodNamesOfInterest(INamedTypeSymbol? regexType, ISyntaxFacts syntaxFacts)
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)
278HashSet<ProjectId> linkedProjectIds,
Extensions\ExtensionMessageHandlerService.cs (3)
58private readonly (HashSet<string> workspace, HashSet<string> document) _unregisteredHandlerNames_useOnlyUnderLock = ([], []); 201var unregisteredHandlerNames = isSolution
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (1)
217var set = new HashSet<string>();
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
553using 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)
49protected virtual bool IsReadOutside(ISymbol symbol, HashSet<ISymbol> readOutsideMap) 426var candidates = new HashSet<ISymbol>(readInsideMap); 820ITypeSymbol 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)
96var builder = new HashSet<ISymbol>(SymbolEquivalenceComparer.Instance); 109var seenLocations = new HashSet<(string filePath, TextSpan span)>(); 128static 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 (1)
430HashSet<ISymbol> referencedVariables,
NavigateTo\NavigateToSearcher.cs (5)
42private static readonly ObjectPool<HashSet<INavigateToSearchResult>> s_searchResultPool = new(() => new(NavigateToSearchResultComparer.Instance)); 348HashSet<INavigateToSearchResult> seenResults, 413HashSet<INavigateToSearchResult> seenItems, 431HashSet<INavigateToSearchResult> seenItems, 463HashSet<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)
506var 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 (3)
118private static readonly ObjectPool<HashSet<ISymbol>> s_originalDefinitionSymbolHashSetPool = new(() => new(OriginalDefinitionSymbolEqualityComparer.Instance)); 136private readonly HashSet<IPropertySymbol> _propertiesWithShadowGetAccessorUsages = new(OriginalDefinitionSymbolEqualityComparer.Instance); 675HashSet<ISymbol> builder,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (10)
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); 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)
142static bool ContainsLocalReference(HashSet<ILocalSymbol> declaredPatternSymbols, IOperation? target)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
439var 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)
101var dependencyNames = new HashSet<string>();
UnusedReferences\UnusedReferencesRemover.cs (9)
33HashSet<string> usedAssemblyFilePaths = []; 34HashSet<string> usedProjectFileNames = []; 64HashSet<string> usedAssemblyFilePaths, 65HashSet<string> usedProjectFileNames, 129HashSet<string> usedAssemblyFilePaths, 130HashSet<string> usedProjectFileNames) 185HashSet<string> usedAssemblyFilePaths) 235internal static bool ContainsAnyCompilationAssembly(ReferenceInfo reference, HashSet<string> usedAssemblyFilePaths) 245internal static void RemoveAllCompilationAssemblies(ReferenceInfo reference, HashSet<string> usedAssemblyFilePaths)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
166var linkedFiles = new HashSet<DocumentId>(); 357HashSet<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 (8)
Interactive\Core\InteractiveHost.Service.cs (1)
734var uniqueDirectories = new HashSet<string>(directories);
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
16/// 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 (2)
HostWorkspace\LoadedProject.cs (2)
244var newItems = new HashSet<T>(loadedCollection, comparer); 245var oldItems = new HashSet<T>(comparer);
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.PublicApiAnalyzers (9)
DeclarePublicApiAnalyzer.Impl.cs (1)
515var publicApiLinesForSiblingsOfSymbol = new HashSet<string>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
Microsoft.CodeAnalysis.Remote.ServiceHub (25)
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\RemoteSolutionCache.cs (1)
161public void AddAllTo(HashSet<TSolution> solutions)
Host\RemoteWorkspace_SolutionCaching.cs (1)
122public 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 (1)
363using var pooledObject = SharedPools.Default<HashSet<object>>().GetPooledObject();
Services\DiagnosticAnalyzer\PerformanceQueue.cs (2)
69using var pooledSet = SharedPools.Default<HashSet<int>>().GetPooledObject(); 149public void AppendAnalyzers(HashSet<int> analyzerSet)
Services\ExtensionMethodImportCompletion\RemoteExtensionMethodImportCompletionService.cs (1)
54var namespaceInScopeSet = new HashSet<string>(namespaceInScope, syntaxFacts.StringComparer);
Services\ProcessTelemetry\RemoteProcessTelemetryService.cs (1)
81var functionIdsSet = new HashSet<FunctionId>(functionIds);
Microsoft.CodeAnalysis.Remote.Workspaces (6)
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 (3)
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 (11)
AbstractResxGenerator.cs (1)
150var names = new HashSet<string>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
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)
33private HashSet<object> _lazyVisitedObjects; 35private HashSet<object> VisitedObjects
Microsoft.CodeAnalysis.Test.Utilities (43)
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)
885internal static void EmitReferences(Compilation compilation, HashSet<string> fullNameSet, List<ModuleData> dependencies, AssemblyIdentity corLibIdentity) 958var 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;
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 (6)
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
16/// 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)
634HashSet<T> firstValues = new HashSet<T>(count); 635HashSet<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)
31Private 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)
40Friend 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)
500uniqueAttributeTypes 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)
335Friend 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.VisualBasic.Syntax.UnitTests (2)
IncrementalParser\SyntaxDifferences.vb (2)
24Private Sub GetRebuiltNodes(newNode As SyntaxNodeOrToken, hashSet As HashSet(Of GreenNode), nodes As ArrayBuilder(Of SyntaxNodeOrToken)) 36Private Sub GatherNodes(node As SyntaxNodeOrToken, hashSet As HashSet(Of GreenNode))
Microsoft.CodeAnalysis.Workspaces (233)
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)
20using SymbolSet = HashSet<INamedTypeSymbol>; 64Func<INamedTypeSymbol, SymbolSet, bool> typeMatches, 106using var _1 = GetSymbolSet(out var result); 110using var _2 = GetSymbolSet(out var currentMetadataTypes); 113using var _3 = GetSymbolSet(out var currentSourceAndMetadataTypes); 152using var _ = GetSymbolSet(out var tempBuffer); 171using var _ = GetSymbolSet(out var tempBuffer); 189async Task AddDescendantSourceTypesInProjectAsync(SymbolSet result, Project project) 199using var _1 = GetSymbolSet(out var typesToSearchFor); 200using var _2 = GetSymbolSet(out var tempBuffer); 253SymbolSet result, 275async Task AddSourceTypesThatDeriveFromNameAsync(SymbolSet result, string name) 291async Task AddDescendantMetadataTypesInProjectAsync(SymbolSet result, Project project) 300using var _1 = GetSymbolSet(out var typesToSearchFor); 301using var _2 = GetSymbolSet(out var tempBuffer); 332SymbolSet metadataTypes, 336SymbolSet result) 375SymbolSet foundTypes, Func<Location, bool> assert, string message) 381private static void AddRange(SymbolSet foundTypes, SymbolSet result) 388private static void AddRange(SymbolSet foundTypes, SymbolSet currentTypes, Func<INamedTypeSymbol, bool> shouldContinueSearching) 512private static bool TypeHasBaseTypeInSet(INamedTypeSymbol type, SymbolSet set) 518private static bool TypeHasInterfaceInSet(INamedTypeSymbol type, SymbolSet set) 535SymbolSet result, 536SymbolSet typesToSearchFor, 537SymbolSet tempBuffer, 560public 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)
34ISymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken); 803TSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, 827ISymbol symbol, HashSet<string>? globalAliases, Project project,
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (1)
21HashSet<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)
42HashSet<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>(); 68var set = new HashSet<ILogger>();
Notification\AbstractGlobalOperationNotificationService.cs (2)
20private readonly HashSet<IDisposable> _registrations = []; 21private readonly HashSet<string> _operations = [];
Remote\RemoteArguments.cs (1)
204public readonly HashSet<SerializableSymbolAndProjectId> Symbols = [.. symbols];
Rename\ConflictEngine\ConflictingIdentifierTracker.cs (1)
17private readonly HashSet<SyntaxToken> _conflictingTokensToReport = [];
Rename\ConflictEngine\ConflictResolver.Session.cs (5)
116var documentIdsThatGetsAnnotatedAndRenamed = new HashSet<DocumentId>(documentsByProject); 302HashSet<DocumentId> documentIdsForConflictResolution, 703var documentIds = new HashSet<DocumentId>(); 731HashSet<DocumentId> documentIds, 777HashSet<DocumentId> documentIdsToRename,
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
70var appliedTextSpans = new HashSet<TextSpan>(); 180var 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) 334private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 345private 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\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
16/// 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\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
20private readonly HashSet<ISymbol> _visited = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
100private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces( 102HashSet<INamedTypeSymbol>? symbols = null)
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\FixedSizeArrayBuilder.cs (1)
64public void AddRange(HashSet<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TopologicalSorter.cs (2)
16var visited = new HashSet<T>(); 37HashSet<T> visited)
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)
25protected async Task<HashSet<T>> GetCommonUnnecessaryImportsOfAllContextAsync( 30var 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 = []; 129private readonly HashSet<IDynamicFileInfoProvider> _eventSubscriptionTracker = [];
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, 220public void AddAllTo(HashSet<Checksum> checksums) 260HashSet<Checksum> searchingChecksumsLeft, 378public void AddAllTo(HashSet<Checksum> checksums) 430HashSet<Checksum> searchingChecksumsLeft, 507public void AddAllTo(HashSet<Checksum> checksums) 516HashSet<Checksum> searchingChecksumsLeft,
Workspace\Workspace.cs (1)
369static Solution UpdateExistingDocumentsToChangedDocumentContents(Solution solution, HashSet<DocumentId> changedDocumentIds)
Workspace\Workspace_Editor.cs (4)
23private readonly Dictionary<ProjectId, HashSet<DocumentId>> _projectToOpenDocumentsMap = []; 67HashSet<DocumentId>? openDocs; 182return _projectToOpenDocumentsMap.TryGetValue(documentId.ProjectId, out var openDocuments) && 199if (_projectToOpenDocumentsMap.TryGetValue(projectId, out var documentIds))
Microsoft.CodeAnalysis.Workspaces.MSBuild (16)
MSBuild\MSBuildProjectLoader.Worker.cs (2)
132var processedPaths = new HashSet<string>(PathUtilities.Comparer); 481var paths = new HashSet<string>(PathUtilities.Comparer);
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (6)
49private readonly ImmutableDictionary<string, HashSet<int>> _pathToIndicesMap; 54private readonly HashSet<int> _indicesToRemove; 66private static ImmutableDictionary<string, HashSet<int>> CreatePathToIndexMap(ImmutableArray<MetadataReference> metadataReferences) 68var builder = ImmutableDictionary.CreateBuilder<string, HashSet<int>>(PathUtilities.Comparer); 122if (filePath != null && _pathToIndicesMap.TryGetValue(filePath, out var indices)) 389if (_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 (30)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
20private HashSet<T>? _set = null;
src\Dependencies\Collections\Extensions\ICollectionExtensions.cs (1)
57public static void AddRange<T>(this ICollection<T> collection, HashSet<T>? values)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
784var set1 = new HashSet<T>(array1, comparer); 785var set2 = new HashSet<T>(array2, comparer); 822var set = new HashSet<T>(comparer); 1096var set = new HashSet<T>(comparer);
src\Dependencies\Collections\Internal\InsertionBehavior.cs (1)
16/// 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 =
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (1)
64public void AddRange(HashSet<T> values)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
NetCoreTests.cs (6)
221var projectPaths = new HashSet<string>(); 222var outputFilePaths = new HashSet<string>(); 311var projectPaths = new HashSet<string>(); 312var outputFilePaths = new HashSet<string>(); 326var expectedNames = new HashSet<string>() 334var actualNames = new HashSet<string>();
SolutionGeneration.cs (1)
66var 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)
332var expectedMatchedLines = new HashSet<int> { 3, 13, 14 }; 396var projectIds = new HashSet<ProjectId>(); 640private 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.AsmDiff (7)
AssemblySet.cs (7)
29var includedAssemblySet = new HashSet<IAssembly>(includedAssemblies); 55var processedSet = new HashSet<IAssemblyReference>(); 145var loadedAssembliesSet = new HashSet<IAssembly>(loadedAssemblies); 159var processedSet = new HashSet<IAssembly>(); 180var includedAssemblySet = new HashSet<IAssembly>(includedAssemblies); 185var requiredAssemblySet = new HashSet<IAssembly>(GetRequiredAssemblies(includedAssemblySet)); 194var processedIdentities = new HashSet<AssemblyIdentity>();
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)
186public readonly Dictionary<TargetFeedContentType, HashSet<TargetFeedConfig>> FeedConfigs = 187new Dictionary<TargetFeedContentType, HashSet<TargetFeedConfig>>(); 189public readonly Dictionary<TargetFeedContentType, HashSet<PackageArtifactModel>> PackagesByCategory = 190new Dictionary<TargetFeedContentType, HashSet<PackageArtifactModel>>(); 192public readonly Dictionary<TargetFeedContentType, HashSet<BlobArtifactModel>> BlobsByCategory = 193new Dictionary<TargetFeedContentType, HashSet<BlobArtifactModel>>(); 381var packages = packagesPerCategory.Value; 383if (FeedConfigs.TryGetValue(category, out HashSet<TargetFeedConfig> feedConfigsForCategory)) 394HashSet<PackageArtifactModel> filteredPackages = SplitPackageByAssetSelection(packages, feedConfig); 433HashSet<BlobArtifactModel> symbolAssets, 508HashSet<BlobArtifactModel> symbolPackages) 540var symbolPackagesToPublish = BlobsByCategory.TryGetValue(TargetFeedContentType.Symbols, out HashSet<BlobArtifactModel> symbolAssets) ? 552HashSet<TargetFeedConfig> feedConfigsForSymbols = FeedConfigs[TargetFeedContentType.Symbols]; 702HashSet<string> packageFileExclusions = []; 796public SymbolPublishVisibility GetSymbolPublishingVisibility(HashSet<TargetFeedConfig> feedConfigsForSymbols) 825var packages = packagesPerCategory.Value; 827if (FeedConfigs.TryGetValue(category, out HashSet<TargetFeedConfig> feedConfigsForCategory)) 831HashSet<PackageArtifactModel> filteredPackages = SplitPackageByAssetSelection(packages, feedConfig); 870protected virtual HashSet<PackageArtifactModel> SplitPackageByAssetSelection(HashSet<PackageArtifactModel> packages, TargetFeedConfig feedConfig) 1045var blobs = blobsPerCategory.Value; 1047if (FeedConfigs.TryGetValue(category, out HashSet<TargetFeedConfig> feedConfigsForCategory)) 1051HashSet<BlobArtifactModel> filteredBlobs = FilterBlobs(blobs, feedConfig); 1089private HashSet<BlobArtifactModel> FilterBlobs(HashSet<BlobArtifactModel> blobs, TargetFeedConfig feedConfig) 1172HashSet<PackageArtifactModel> packagesToPublish, 1207HashSet<PackageArtifactModel> packagesToPublish, 1294HashSet<PackageArtifactModel> packagesToPublish, 1315HashSet<T> packagesToPublish, 1506private async Task PublishAssetsAsync(IAssetPublisher assetPublisher, HashSet<BlobArtifactModel> blobAssets, 1555HashSet<BlobArtifactModel> assetsToPublish, 1647HashSet<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 (12)
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 (7)
68private readonly Dictionary<SignedFileContentKey, HashSet<string>> _whichPackagesTheFileIsIn; 73private readonly Dictionary<SigningToolErrorCode, HashSet<SignedFileContentKey>> _errors; 138_whichPackagesTheFileIsIn = new Dictionary<SignedFileContentKey, HashSet<string>>(); 139_errors = new Dictionary<SigningToolErrorCode, HashSet<SignedFileContentKey>>(); 156if (!_whichPackagesTheFileIsIn.TryGetValue(fileUniqueKey, out var packages)) 594if (!_errors.TryGetValue(code, out var filesErrored)) 766if (!_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 (1)
408private readonly HashSet<string> specialExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
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.OpenAI (2)
OpenAIChatClient.cs (1)
747public HashSet<string> Required { get; set; } = [];
OpenAIResponseChatClient.cs (1)
593public 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), 583HashSet<string> propertyNames = new(StringComparer.OrdinalIgnoreCase); 879Type 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.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)
602private 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 (24)
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
38private readonly HashSet<ParameterViewModel> _disabledParameters = [];
CommonControls\MemberSelectionViewModel.cs (2)
173var visited = new HashSet<ISymbol>(); 174var 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)
160var linkedDocumentIds = new HashSet<DocumentId>();
Progression\GraphQueries\ContainsGraphQuery.cs (1)
27var newNodes = new HashSet<GraphNode>();
Progression\GraphQueries\InheritsGraphQuery.cs (1)
28var newNodes = new HashSet<GraphNode>();
Progression\GraphQueryManager.cs (1)
125var tasks = graphQueries.Select(q => Task.Run(() => q.GetGraphAsync(solution, context, cancellationToken), cancellationToken)).ToHashSet();
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 (1)
551var latestDiagnosticsToFix = filterStaleDiagnostics ? new HashSet<DiagnosticData>() : null;
Venus\ContainedDocument.cs (3)
256SharedPools.Default<HashSet<int>>().ClearAndFree((HashSet<int>)affectedVisibleSpanIndices); 726var affectedSpans = SharedPools.Default<HashSet<int>>().AllocateAndClear();
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
ReferenceCodeLensProvider.cs (1)
48private readonly Dictionary<Guid, (string version, HashSet<DataPoint> dataPoints)> _dataPoints = [];
MSBuild (17)
AssemblyNameExtension.cs (4)
67private HashSet<AssemblyNameExtension> remappedFrom; 170remappedFrom = (HashSet<AssemblyNameExtension>)info.GetValue("remapped", typeof(HashSet<AssemblyNameExtension>)); 229private static HashSet<AssemblyNameExtension> CreateRemappedFrom()
CommandLineSwitches.cs (2)
384HashSet<string> parameterizedSwitchResourceIds = new HashSet<string>(); 401HashSet<string> parameterlessSwitchResourceIds = new HashSet<string>();
CoreCLRAssemblyLoader.cs (1)
24private readonly HashSet<string> _dependencyPaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
TranslatorHelpers.cs (2)
177ref HashSet<T> hashSet, 179NodePacketCollectionCreator<HashSet<T>> collectionFactory) where T : class, ITranslatable
XMake.cs (1)
3559HashSet<string> extensionsToIgnore = new HashSet<string>(projectsExtensionsToIgnore ?? [], StringComparer.OrdinalIgnoreCase);
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
XMakeElements.cs (1)
48internal static readonly HashSet<string> ReservedItemNames =
MSBuildTaskHost (18)
AssemblyNameExtension.cs (4)
67private HashSet<AssemblyNameExtension> remappedFrom; 170remappedFrom = (HashSet<AssemblyNameExtension>)info.GetValue("remapped", typeof(HashSet<AssemblyNameExtension>)); 229private static HashSet<AssemblyNameExtension> CreateRemappedFrom()
BinaryTranslator.cs (4)
298public void Translate(ref HashSet<string> set) 600public void TranslateDictionary(ref Dictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys) 1102public void Translate(ref HashSet<string> set) 1382public void TranslateDictionary(ref Dictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys)
ITranslator.cs (2)
183void Translate(ref HashSet<string> set); 321void TranslateDictionary(ref Dictionary<string, string> dictionary, IEqualityComparer<string> comparer, ref Dictionary<string, string> additionalEntries, HashSet<string> additionalEntriesKeys);
Modifiers.cs (1)
72private static readonly HashSet<string> s_tableOfItemSpecModifiers = new HashSet<string>(All, StringComparer.OrdinalIgnoreCase);
TranslatorHelpers.cs (2)
177ref HashSet<T> hashSet, 179NodePacketCollectionCreator<HashSet<T>> collectionFactory) where T : class, ITranslatable
XMakeAttributes.cs (5)
104private static readonly HashSet<string> KnownSpecialTaskAttributes = new HashSet<string> { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 106private static readonly HashSet<string> KnownSpecialTaskAttributesIgnoreCase = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { condition, continueOnError, msbuildRuntime, msbuildArchitecture, xmlns }; 108private static readonly HashSet<string> KnownBatchingTargetAttributes = new HashSet<string> { name, condition, dependsOnTargets, beforeTargets, afterTargets }; 110private static readonly HashSet<string> ValidMSBuildRuntimeValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildRuntimeValues.clr2, MSBuildRuntimeValues.clr4, MSBuildRuntimeValues.currentRuntime, MSBuildRuntimeValues.net, MSBuildRuntimeValues.any }; 112private static readonly HashSet<string> ValidMSBuildArchitectureValues = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { MSBuildArchitectureValues.x86, MSBuildArchitectureValues.x64, MSBuildArchitectureValues.arm64, MSBuildArchitectureValues.currentArchitecture, MSBuildArchitectureValues.any };
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)
151var outputSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase); 225var hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
Roslyn.Diagnostics.Analyzers (14)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\TelemetryPanel.xaml.cs (1)
60var seenType = new HashSet<Type>();
Roslyn.VisualStudio.Next.UnitTests (3)
Options\VisualStudioOptionStorageTests.cs (1)
290var 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)
1874var 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)
7[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)
320private 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 (113)
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\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (6)
12private static readonly Dictionary<int, HashSet<Token>> s_registrations = Initialize(); 14private static unsafe Dictionary<int, HashSet<Token>> Initialize() 23return new Dictionary<int, HashSet<Token>>(); 39if (!s_registrations.TryGetValue(signo, out HashSet<Token>? tokens)) 64if (s_registrations.TryGetValue(token.SigNo, out HashSet<Token>? tokens)) 84if (s_registrations.TryGetValue(signo, out HashSet<Token>? registrations))
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 (7)
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);
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 (15)
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
281HashSet<string> duplicateAttributeCheck = new(); 390private static void RejectDuplicateAttributes(AttributeAsn[] bagAttributes, HashSet<string> duplicateAttributeCheck)
System\Security\Cryptography\X509Certificates\CertificatePolicy.cs (6)
230HashSet<string>? applicationCertPolicies = null; 231HashSet<string>? ekus = null; 314private static HashSet<string> ReadExtendedKeyUsageExtension(byte[] rawData) 316HashSet<string> oids = new HashSet<string>(); 338internal static HashSet<string> ReadCertPolicyExtension(byte[] rawData) 346HashSet<string> policies = new HashSet<string>();
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
1012HashSet<string?> usedOids = new HashSet<string?>(CertificateExtensions.Count);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
238HashSet<string> policyOids = CertificatePolicyChain.ReadCertPolicyExtension(ext.RawData);
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (4)
153var uniqueRootCerts = new HashSet<X509Certificate2>(); 154var uniqueIntermediateCerts = new HashSet<X509Certificate2>(); 155var processedFiles = new HashSet<(long Ino, long Dev)>(); 350var set = new HashSet<string>(directories, StringComparer.Ordinal);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
86var loadedCerts = new HashSet<X509Certificate2>();
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\SignedCms.cs (1)
564var 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 (2)
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; 1505HashSet<string>? memberInitializerNames = null; 1808private static HashSet<ITypeSymbol> CreateBuiltInSupportTypeSet(KnownTypeSymbols knownSymbols) 1811HashSet<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>(); 4997private static string MatchCharacterClass(string chExpr, string charClass, bool negate, HashSet<string> additionalDeclarations, Dictionary<string, string[]> requiredHelpers) 5392private 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)
6922HashSet<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 (8)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
TestDiscoveryWorker (1)
Program.cs (1)
82var testsToWrite = new HashSet<string>();
Text.Analyzers (12)
CodeAnalysisDictionary.cs (2)
32private readonly HashSet<string> _recognizedWords; 44private readonly HashSet<string> _unrecognizedWords;
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (1)
78var namespacesWithTypeMember = new HashSet<INamespaceSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (1)
78var typesInNamespace = new HashSet<INamedTypeSymbol>();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
341var set = new HashSet<IParameterSymbol>(parameters);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
22private static readonly HashSet<T> EmptyHashSet = []; 100private readonly HashSet<T> _set; 102public Enumerable(HashSet<T> set) 113private HashSet<T>.Enumerator _enumerator; 115public Enumerator(HashSet<T>.Enumerator enumerator)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
66var uniqueRulesetPaths = new HashSet<string>(); 106static void ProcessComments(RuleSet ruleset, HashSet<string> processedRulesetPaths, Dictionary<string, string> ruleIdToComments)
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)
409 HashSet<object> expectedRefs, 410 HashSet<object> actualRefs, 556 HashSet<object> expectedRefs, 557 HashSet<object> actualRefs, 599 HashSet<object> expectedRefs, 600 HashSet<object> actualRefs, 689 HashSet<object> expectedRefs, 690 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>()