mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
C#: Address review comments and make more early returns in Populate.
This commit is contained in:
@@ -26,12 +26,20 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
returnType.TypeRef,
|
||||
(UserOperator)OriginalDefinition);
|
||||
|
||||
ContainingType.PopulateGenerics();
|
||||
Overrides(trapFile);
|
||||
|
||||
if (Context.OnlyScaffold)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Context.ExtractLocation(Symbol))
|
||||
{
|
||||
WriteLocationsToTrap(trapFile.operator_location, this, Locations);
|
||||
}
|
||||
|
||||
if (IsSourceDeclaration && !Context.OnlyScaffold)
|
||||
if (IsSourceDeclaration)
|
||||
{
|
||||
var declSyntaxReferences = Symbol.DeclaringSyntaxReferences.Select(s => s.GetSyntax()).ToArray();
|
||||
foreach (var declaration in declSyntaxReferences.OfType<OperatorDeclarationSyntax>())
|
||||
@@ -39,9 +47,6 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
foreach (var declaration in declSyntaxReferences.OfType<ConversionOperatorDeclarationSyntax>())
|
||||
TypeMention.Create(Context, declaration.Type, this, returnType);
|
||||
}
|
||||
|
||||
ContainingType.PopulateGenerics();
|
||||
Overrides(trapFile);
|
||||
}
|
||||
|
||||
public override bool NeedsPopulation => Context.Defines(Symbol) || IsImplicitOperator(out _);
|
||||
|
||||
Reference in New Issue
Block a user