[noescape by default] drop @noescape from stdlib

This commit is contained in:
Michael Ilseman
2016-08-04 16:09:01 -07:00
parent 9e9a1b96c9
commit b7c9eddd11
46 changed files with 168 additions and 168 deletions

View File

@@ -20,7 +20,7 @@
// Property Lists need to be properly bridged
//
func _toNSArray<T, U : AnyObject>(_ a: [T], f: @noescape (T) -> U) -> NSArray {
func _toNSArray<T, U : AnyObject>(_ a: [T], f: (T) -> U) -> NSArray {
let result = NSMutableArray(capacity: a.count)
for s in a {
result.add(f(s))
@@ -50,7 +50,7 @@ extension Optional {
internal func _withNilOrAddress<NSType : AnyObject, ResultType>(
of object: inout NSType?,
_ body:
@noescape (AutoreleasingUnsafeMutablePointer<NSType?>?) -> ResultType
(AutoreleasingUnsafeMutablePointer<NSType?>?) -> ResultType
) -> ResultType {
return self == nil ? body(nil) : body(&object)
}
@@ -96,7 +96,7 @@ extension String {
/// memory referred to by `index`
func _withOptionalOutParameter<Result>(
_ index: UnsafeMutablePointer<Index>?,
_ body: @noescape (UnsafeMutablePointer<Int>?) -> Result
_ body: (UnsafeMutablePointer<Int>?) -> Result
) -> Result {
var utf16Index: Int = 0
let result = (index != nil ? body(&utf16Index) : body(nil))
@@ -109,7 +109,7 @@ extension String {
/// it into the memory referred to by `range`
func _withOptionalOutParameter<Result>(
_ range: UnsafeMutablePointer<Range<Index>>?,
_ body: @noescape (UnsafeMutablePointer<NSRange>?) -> Result
_ body: (UnsafeMutablePointer<NSRange>?) -> Result
) -> Result {
var nsRange = NSRange(location: 0, length: 0)
let result = (range != nil ? body(&nsRange) : body(nil))