Skip to content

Commit 313c9ac

Browse files
committed
C#: Address review comments.
1 parent 25d5c81 commit 313c9ac

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

csharp/extractor/Semmle.Extraction/Context.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public Entity CreateNonNullEntity<Type, Entity>(ICachedEntityFactory<Type, Entit
165165
if (init is null) throw new ArgumentException("Unexpected null value", nameof(init));
166166

167167
if (objectEntityCache.TryGetValue(init, out var cached))
168-
return (Entity)cached!;
168+
return (Entity)cached;
169169

170170
using (StackGuard)
171171
{

csharp/extractor/Semmle.Extraction/Id.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ public class FreshId : IId
3434

3535
public override string ToString() => "*";
3636

37-
public override bool Equals(object? obj)
38-
{
39-
// Expand logic to allow for nullability control flow analysis
40-
if (obj is null) return false;
41-
return obj.GetType() == GetType();
42-
}
37+
public override bool Equals(object? obj) => obj?.GetType() == GetType();
4338

4439
public override int GetHashCode() => 0;
4540

0 commit comments

Comments
 (0)