C#: Address review comments.

This commit is contained in:
Calum Grant
2020-05-07 10:35:29 +01:00
parent 25d5c81896
commit 313c9ac6ec
2 changed files with 2 additions and 7 deletions

View File

@@ -165,7 +165,7 @@ namespace Semmle.Extraction
if (init is null) throw new ArgumentException("Unexpected null value", nameof(init));
if (objectEntityCache.TryGetValue(init, out var cached))
return (Entity)cached!;
return (Entity)cached;
using (StackGuard)
{

View File

@@ -34,12 +34,7 @@ namespace Semmle.Extraction
public override string ToString() => "*";
public override bool Equals(object? obj)
{
// Expand logic to allow for nullability control flow analysis
if (obj is null) return false;
return obj.GetType() == GetType();
}
public override bool Equals(object? obj) => obj?.GetType() == GetType();
public override int GetHashCode() => 0;