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

Adopt Equatable and Hashable by PhoneNumber. #103

Merged
merged 2 commits into from
Jan 23, 2017

Conversation

artyom-stv
Copy link
Contributor

No description provided.

@Jean-Daniel
Copy link

Out of curiosity, why don't you just use Int.hashValue instead of using tricks with Int(truncatingBitPattern:) and MemoryLayout.

 public var hashValue: Int {
  return countryCode.hashValue ^ nationalNumber.hashValue + leadingZero.hashValue + numberExtension?.hashValue ?? 0
}

@artyom-stv
Copy link
Contributor Author

artyom-stv commented Jan 14, 2017

You are right. I didn't think of it (that Int64 conforms to Hashable too).

@marmelroy
Copy link
Owner

Thanks @artyom-stv

@marmelroy marmelroy merged commit 518ed07 into marmelroy:master Jan 23, 2017
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.

3 participants