Skip to content

Commit ab4e643

Browse files
committed
C#: Turn RuntimeVersion into a record type.
1 parent 2b74144 commit ab4e643

File tree

1 file changed

+1
-6
lines changed
  • csharp/extractor/Semmle.Extraction.CSharp.Standalone

1 file changed

+1
-6
lines changed

csharp/extractor/Semmle.Extraction.CSharp.Standalone/Runtime.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal partial class Runtime
2222

2323
public Runtime(IDotNet dotNet) => this.dotNet = dotNet;
2424

25-
internal sealed class RuntimeVersion : IComparable<RuntimeVersion>
25+
internal record RuntimeVersion : IComparable<RuntimeVersion>
2626
{
2727
private readonly string dir;
2828
private readonly Version version;
@@ -71,11 +71,6 @@ public int CompareTo(RuntimeVersion? other)
7171
return c;
7272
}
7373

74-
public override bool Equals(object? obj) =>
75-
obj is not null && obj is RuntimeVersion other && other.FullPath == FullPath;
76-
77-
public override int GetHashCode() => FullPath.GetHashCode();
78-
7974
public override string ToString() => FullPath;
8075
}
8176

0 commit comments

Comments
 (0)