Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Implement Equals/GetHashCode for CombinedDependencyListEntry - #1202

Merged
MichalStrehovsky merged 2 commits into
dotnet:masterfrom
MichalStrehovsky:depListEntry
Apr 27, 2016
Merged

MichalStrehovsky merged 2 commits into
dotnet:masterfrom
MichalStrehovsky:depListEntry

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

This was falling back to the runtime supplied implementation which has
pretty bad perf characteristics.

Also made the fields read only and implemented IEquatable for good
measure.

This was falling back to the runtime supplied implementation which has
pretty bad perf characteristics.

Also made the fields read only and implemented IEquatable for good
measure.
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@davidwrighton Can you please have a look?


public bool Equals(CombinedDependencyListEntry other)
{
return Object.Equals(Node, other.Node)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DependencyNode's don't quite work unless the nodes are single instanced and reference comparable. I think you could just use == or Object.ReferenceEquals here. (We should probably also make DependencyNode override Equals to do the same and make it sealed.)

@davidwrighton

Copy link
Copy Markdown
Member

Looks good to me.

@MichalStrehovsky
MichalStrehovsky merged commit 1a6c068 into dotnet:master Apr 27, 2016
@MichalStrehovsky
MichalStrehovsky deleted the depListEntry branch April 27, 2016 20:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants