Skip to content

Make algorithms generic over IndexDistance #1382

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
merged 1 commit into from
Oct 28, 2017

Conversation

airspeedswift
Copy link
Member

@airspeedswift airspeedswift commented Oct 27, 2017

A PR on the swift repo, swiftlang/swift#12641, attempts to remove IndexDistance.

SwiftPM currently has a couple of places where it constrains IndexDistance to Int. This PR changes those places to work with any IndexDistance so we can remove it on the swift repo without source-breaking SwiftPM.

(we're working on the source compatibility story for this for other code outside swift-* stuff, but would be good to be able to test/land the change on master in the mean-time)

@airspeedswift airspeedswift changed the title [WIP Do not merge]Remove references to IndexDistance for testing purposes Make algorithms generic over IndexDistance Oct 27, 2017
@airspeedswift
Copy link
Member Author

@swift-ci please test

@aciidgh
Copy link
Contributor

aciidgh commented Oct 28, 2017

Thanks!

@swift-ci please smoke test

guard i != j else { continue }
swap(&self[i], &self[j])
let i = index(firstUnshuffled, offsetBy: numericCast(d))
swapAt(firstUnshuffled, i)
Copy link
Contributor

@aciidgh aciidgh Oct 28, 2017

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I can do that one in a separate PR right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, its a separate repo anyway.

@airspeedswift airspeedswift merged commit 70805c8 into swiftlang:master Oct 28, 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.

2 participants