mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "stdlib: make map() dynamically dispatched"
This reverts commit r27607. It broke parse_stdlib_* tests. Swift SVN r27609
This commit is contained in:
@@ -378,6 +378,23 @@ extension SequenceType {
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// map()
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
extension SequenceType {
|
||||
/// Return an `Array` containing the results of mapping `transform`
|
||||
/// over `self`.
|
||||
final public func _prext_map<T>(
|
||||
@noescape transform: (${GElement}) -> T
|
||||
) -> [T] {
|
||||
// Cast away @noescape.
|
||||
typealias Transform = (${GElement}) -> T
|
||||
let escapableTransform = unsafeBitCast(transform, Transform.self)
|
||||
return Array<T>(lazy(self).map(escapableTransform))
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// flatMap()
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user