Skip to content

[gardening] Prefer Array(seq) over seq.map { $0 } #867

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
Feb 10, 2017

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Feb 3, 2017

No description provided.

@ikesyo
Copy link
Member Author

ikesyo commented Feb 3, 2017

@swift-ci please test

@pushkarnk
Copy link
Member

@ikesyo I'm just curious if there a reason (performance or only elegance?) why we should prefer Array(seq) over seq.map { $0 }. Thanks.

@ikesyo
Copy link
Member Author

ikesyo commented Feb 3, 2017

@pushkarnk I think that the former would/should be more efficient and the intent would be clearer (and also the latter looks a bit weird to me).

See also an issue on SwiftLint project: realm/SwiftLint#1271.

@parkera
Copy link
Contributor

parkera commented Feb 3, 2017

For the files that are also part of the overlay, let's also raise a PR there to make the same changes.

@ikesyo
Copy link
Member Author

ikesyo commented Feb 4, 2017

Submitted swiftlang/swift#7243.

@parkera
Copy link
Contributor

parkera commented Feb 5, 2017

LGTM

@ikesyo
Copy link
Member Author

ikesyo commented Feb 10, 2017

@swift-ci test and merge

@swift-ci swift-ci merged commit 24967b1 into swiftlang:master Feb 10, 2017
@ikesyo ikesyo deleted the gardening-seq-to-array-conversion branch February 10, 2017 05:37
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