Skip to content

Commit 7ba18ec

Browse files
Copilotstephentoub
andcommitted
Fix code review feedback: use SymbolEqualityComparer for AsParallel methods
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 5c2cf19 commit 7ba18ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers/Microsoft.NetCore.Analyzers/Performance/DoNotUseAsParallelInForEachLoop.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ private static void OnCompilationStart(CompilationStartAnalysisContext context)
5252
return;
5353
}
5454

55-
// Get all AsParallel methods
56-
var asParallelMethods = ImmutableHashSet.CreateRange(
55+
// Get all AsParallel methods - use SymbolEqualityComparer for proper comparison
56+
var asParallelMethods = ImmutableHashSet.CreateRange<IMethodSymbol>(
57+
SymbolEqualityComparer.Default,
5758
parallelEnumerableType.GetMembers("AsParallel").OfType<IMethodSymbol>());
5859

5960
if (asParallelMethods.IsEmpty)

0 commit comments

Comments
 (0)