Revert "stdlib: make map() dynamically dispatched"

This reverts commit r27607.  It broke parse_stdlib_* tests.

Swift SVN r27609
This commit is contained in:
Dmitri Hrybenko
2015-04-22 22:30:45 +00:00
parent 212c6e3be2
commit 730e6afee0
4 changed files with 18 additions and 44 deletions

View File

@@ -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()
//===----------------------------------------------------------------------===//