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

Remove argument that was always passed the same value #77045

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 5, 2025
@@ -30,9 +30,8 @@ private async Task<ProjectAnalysisData> GetProjectAnalysisDataAsync(
try
{
// PERF: We need to flip this to false when we do actual diffing.
var avoidLoadingData = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

always passing true here.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe remove the comment

Copy link
Member Author

Choose a reason for hiding this comment

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

sgtm.

@@ -92,15 +92,15 @@ public DiagnosticAnalysisResult GetResult(DiagnosticAnalyzer analyzer)
public bool TryGetResult(DiagnosticAnalyzer analyzer, out DiagnosticAnalysisResult result)
=> Result.TryGetValue(analyzer, out result);

public static async Task<ProjectAnalysisData> CreateAsync(Project project, IEnumerable<StateSet> stateSets, bool avoidLoadingData, CancellationToken cancellationToken)
public static async Task<ProjectAnalysisData> CreateAsync(Project project, ImmutableArray<StateSet> stateSets, CancellationToken cancellationToken)
Copy link
Member Author

Choose a reason for hiding this comment

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

always passed true into here.

{
VersionStamp? version = null;

var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, DiagnosticAnalysisResult>();
foreach (var stateSet in stateSets)
{
var state = stateSet.GetOrCreateProjectState(project.Id);
var result = await state.GetAnalysisDataAsync(project, avoidLoadingData, cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

always passed true into here.

@@ -67,7 +67,7 @@ public async Task<DiagnosticAnalysisResult> GetAnalysisDataAsync(Project project
// PERF: avoid loading data if version is not right one.
// avoid loading data flag is there as a strictly perf optimization.
var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false);
if (avoidLoadingData && lastResult.Version != version)
if (lastResult.Version != version)
Copy link
Member Author

Choose a reason for hiding this comment

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

so this can trivially be removed.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review February 5, 2025 02:45
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 5, 2025 02:45
Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants