Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RPC23 #266

Merged
merged 3 commits into from
Jan 17, 2024
Merged

Implement RPC23 #266

merged 3 commits into from
Jan 17, 2024

Conversation

SergeyTeplyakov
Copy link
Owner

Implements 'Avoid using Enumerable.Contains on HashSet' analyzer.

Here is an example:

image

Implements 'Avoid using Enumerable.Contains on HashSet<string>' analyzer
SergeyTeplyakov and others added 2 commits January 17, 2024 12:40
…yzer.cs

Co-authored-by: Jared Parsons <jared@paranoidcoding.org>
@SergeyTeplyakov SergeyTeplyakov merged commit 2cfa63e into master Jan 17, 2024
// and the second one that takes StringComparer,
// and only the second one is linear.
methodSymbol.Parameters.Length == 3 &&
methodSymbol.ContainingType.IsClrType(compilation, typeof(System.Linq.Enumerable));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergeyTeplyakov I came across this PR from Twitter. I think this has performance implications as it will cause compilation.GetTypeByMetadataName to be called multiple times.

Generally, the needed symbols should be retrieved first in a compilation start action, then do symbol comparison in the operation action here.

@Youssef1313 Youssef1313 mentioned this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants