Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public CompilationOptions(System.Collections.Generic.IEnumerable<string> defines
public bool? PublicSign { get { throw null; } }
public bool? WarningsAsErrors { get { throw null; } }
}
public partial struct Dependency
public readonly partial struct Dependency : System.IEquatable<Dependency>
{
private object _dummy;
private int _dummyPrimitive;
private readonly object _dummy;
private readonly int _dummyPrimitive;
public Dependency(string name, string version) { throw null; }
public readonly string Name { get { throw null; } }
public readonly string Version { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.Extensions.DependencyModel
{
public struct Dependency
public readonly struct Dependency : IEquatable<Dependency>
{
public Dependency(string name, string version)
{
Expand All @@ -30,11 +30,7 @@ public bool Equals(Dependency other)
return string.Equals(Name, other.Name) && string.Equals(Version, other.Version);
}

public override bool Equals(object obj)
{
if (obj is null) return false;
return obj is Dependency && Equals((Dependency) obj);
}
public override bool Equals(object obj) => obj is Dependency dependency && Equals(dependency);

public override int GetHashCode() =>
HashHelpers.Combine(Name.GetHashCode(), Version.GetHashCode());
Expand Down