Skip to content

[gardening] Remove duplicate code in NSCalendar #1628

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

Merged

Conversation

otaviolima
Copy link
Contributor

Removed code seems to be a wrong copy-paste inside each function.

@otaviolima otaviolima changed the title Remove duplicate code in NSCalendar [gardening] Remove duplicate code in NSCalendar Jul 11, 2018
@spevans
Copy link
Contributor

spevans commented Jul 11, 2018

Could the remaining code be simplified down to:

yearValuePointer?.pointee = comps.year ?? NSDateComponentUndefined
etc...

to cut down on the large if/else trees?

@otaviolima
Copy link
Contributor Author

I will do it, once I fix this:

<unknown>:0: error: Swift does not support the SDK 'MacOSX10.13.sdk'
Command /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-07-11-a.xctoolchain/usr/bin/swiftc failed with exit code 1

Google is not helping much to fix that. :/

@spevans
Copy link
Contributor

spevans commented Jul 12, 2018

@otaviolima Are you using the Xcode10 beta? Because that is required for current snapshots.

@otaviolima
Copy link
Contributor Author

otaviolima commented Jul 12, 2018

I was, but it started giving me another error then I switch back to Xcode 9 then above error was shown.

I'm installing Xcode 10 beta 3 now.

@otaviolima otaviolima force-pushed the remove-nscalendar-duplicate-code branch from 1de9a94 to 5c3a237 Compare July 16, 2018 14:30
@otaviolima otaviolima force-pushed the remove-nscalendar-duplicate-code branch from 5c3a237 to 66eaab1 Compare July 16, 2018 14:33
@otaviolima
Copy link
Contributor Author

Done.

@spevans
Copy link
Contributor

spevans commented Jul 16, 2018

@swift-ci please test

@otaviolima
Copy link
Contributor Author

It passed: https://ci.swift.org/view/Pull%20Request/job/swift-corelibs-foundation-PR-Linux/1160/console

Is the reporting/github hook broken?

@spevans
Copy link
Contributor

spevans commented Jul 17, 2018

@otaviolima Its quite common that the CI->GitHub update hook doesn't always work, I'll kick off another test just to see if it updates

@spevans
Copy link
Contributor

spevans commented Jul 17, 2018

@swift-ci please test

@millenomi
Copy link
Contributor

@swift-ci please test and merge

@swift-ci swift-ci merged commit fa8a1c2 into swiftlang:master Oct 10, 2018
@otaviolima otaviolima deleted the remove-nscalendar-duplicate-code branch October 11, 2018 05:24
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.

4 participants