Skip to content

Commit 4c1e84b

Browse files
committed
C#: Address review comments.
1 parent 4dedc45 commit 4c1e84b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/OrdinaryMethod.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,12 @@ public override void Populate(TextWriter trapFile)
5252
ExtractCompilerGenerated(trapFile);
5353
}
5454

55-
private bool IsCompilerGeneratedDelegate()
56-
{
55+
private bool IsCompilerGeneratedDelegate() =>
5756
// Lambdas with parameter defaults or a `params` parameter are implemented
5857
// using compiler generated delegate types.
59-
if (Symbol.MethodKind == MethodKind.DelegateInvoke &&
60-
Symbol.ContainingType is INamedTypeSymbol nt)
61-
{
62-
return nt.TypeKind == TypeKind.Delegate && nt.IsImplicitlyDeclared;
63-
}
64-
return false;
65-
}
58+
Symbol.MethodKind == MethodKind.DelegateInvoke &&
59+
Symbol.ContainingType is INamedTypeSymbol nt &&
60+
nt.IsImplicitlyDeclared;
6661

6762
public static new OrdinaryMethod Create(Context cx, IMethodSymbol method)
6863
{

0 commit comments

Comments
 (0)