Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PartialEq and Hash for Node based on NodeId #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swagle8987
Copy link
Collaborator

I've added PartialEq and Hash based on comparing the id field for the Node. This makes sure that the Hash of the Node is the same as the Hash of its id but in order to preserve logical consistency, the PartialEq implementation ignore all other fields in the struct

@swagle8987 swagle8987 linked an issue Mar 1, 2024 that may be closed by this pull request
@sriram98v
Copy link
Owner

I do not think comparing node ids alone is sufficient partialeq. I think the hash implementation is fine. I think PartialEq should be removed.

Copy link
Owner

@sriram98v sriram98v left a comment

Choose a reason for hiding this comment

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

remove PartialEq implementation. When comparing nodes, more than the node ids matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PartialEq and Hash not defined for Node
2 participants