Skip to content

Conform NSDate to Comparable #19

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

Closed
wants to merge 2 commits into from
Closed

Conform NSDate to Comparable #19

wants to merge 2 commits into from

Conversation

chrisamanse
Copy link
Contributor

No description provided.

@JiriTrecak
Copy link

Personally, I think compare function can be shortened so it does not introduce unnecessary overhead, to:

public func <(lhs: NSDate, rhs: NSDate) -> Bool {
    return lhs.timeIntervalSinceReferenceDate < rhs.timeIntervalSinceReferenceDate
}    

@chrisamanse
Copy link
Contributor Author

@JiriTrecak, good point.

Use timeIntervalSinceReferenceDate property directly instead of storing it in a local variable first
@parkera
Copy link
Contributor

parkera commented Dec 5, 2015

This pull request contains an API change, so let’s follow the Swift evolution process, starting with discussing the idea on the swift-evolution and swift-corelibs-dev lists.

@parkera parkera closed this Dec 5, 2015
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Apr 29, 2021
Revert "Disable two tests because they fail in the CI."
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
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