提交 73069349 编写于 作者: C Cyrus Najmabadi

Simplify

上级 be765303
......@@ -16,25 +16,12 @@ internal struct ProjectTelemetryInfo
public int DocumentsCount;
public int AdditionalDocumentsCount;
public ProjectTelemetryInfo(ProjectId projectId, string language, int analyzerReferencesCount, int projectReferencesCount, int metadataReferencesCount, int documentsCount, int additionalDocumentsCount)
{
this.ProjectId = projectId;
this.Language = language;
this.AnalyzerReferencesCount = analyzerReferencesCount;
this.ProjectReferencesCount = projectReferencesCount;
this.MetadataReferencesCount = metadataReferencesCount;
this.DocumentsCount = documentsCount;
this.AdditionalDocumentsCount = additionalDocumentsCount;
}
public bool Equals(ProjectTelemetryInfo other)
{
return this.Language.Equals(other.Language) &&
this.AnalyzerReferencesCount == other.AnalyzerReferencesCount &&
this.ProjectReferencesCount == other.ProjectReferencesCount &&
this.MetadataReferencesCount == other.MetadataReferencesCount &&
this.DocumentsCount == other.DocumentsCount &&
this.AdditionalDocumentsCount == other.AdditionalDocumentsCount;
}
=> Language.Equals(other.Language) &&
AnalyzerReferencesCount == other.AnalyzerReferencesCount &&
ProjectReferencesCount == other.ProjectReferencesCount &&
MetadataReferencesCount == other.MetadataReferencesCount &&
DocumentsCount == other.DocumentsCount &&
AdditionalDocumentsCount == other.AdditionalDocumentsCount;
}
}
......@@ -45,14 +45,16 @@ public override async Task AnalyzeProjectAsync(Project project, bool semanticsCh
var documentsCount = project.DocumentIds.Count;
var additionalDocumentsCount = project.AdditionalDocumentIds.Count;
var info = new ProjectTelemetryInfo(
projectId,
language,
analyzerReferencesCount,
projectReferencesCount,
metadataReferencesCount,
documentsCount,
additionalDocumentsCount);
var info = new ProjectTelemetryInfo
{
ProjectId = projectId,
Language = language,
AnalyzerReferencesCount = analyzerReferencesCount,
ProjectReferencesCount = projectReferencesCount,
MetadataReferencesCount = metadataReferencesCount,
DocumentsCount = documentsCount,
AdditionalDocumentsCount = additionalDocumentsCount,
};
lock (_gate)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册