-
Notifications
You must be signed in to change notification settings - Fork 47
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
[gardening]: remove unneeded code from ChildKey #324
Conversation
func hash(into hasher: inout Hasher) { | ||
hasher.combine(ObjectIdentifier(childType)) | ||
hasher.combine(key) | ||
} | ||
|
||
static func == (lhs: ChildKey, rhs: ChildKey) -> Bool { | ||
lhs.childType == rhs.childType | ||
&& lhs.key == rhs.key | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we get these for free if all our stored properties are Hashable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may find this wrapper useful to do the same thing with better debugging/logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 🤙🏽 - LGTM
func hash(into hasher: inout Hasher) { | ||
hasher.combine(ObjectIdentifier(childType)) | ||
hasher.combine(key) | ||
} | ||
|
||
static func == (lhs: ChildKey, rhs: ChildKey) -> Bool { | ||
lhs.childType == rhs.childType | ||
&& lhs.key == rhs.key | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may find this wrapper useful to do the same thing with better debugging/logging
small refactor of
ChildKey
to remove customHashable
requirement implementations in favor of synthesized ones