Eliminate most remaining uses of _convertNSFooToFoo and _convertFooToNSFoo.

Generalized bridging has fully subsumed most of these. NSError is
still special, and _convertStringToNSString remains for the the
runtime's implementation of SwiftObject's -description method.
This commit is contained in:
Doug Gregor
2016-03-18 10:31:30 -07:00
parent 4c49e67780
commit d92ae77076
11 changed files with 103 additions and 213 deletions

View File

@@ -384,7 +384,7 @@ extension String {
if let matches = nsMatches {
// Since this function is effectively a bridge thunk, use the
// bridge thunk semantics for the NSArray conversion
matchesIntoArray._setIfNonNil { _convertNSArrayToArray(matches) }
matchesIntoArray._setIfNonNil { return matches as! [String] }
}
if let n = nsOutputName {
@@ -406,7 +406,7 @@ extension String {
let nsa = _ns.componentsSeparatedByCharacters(in: separator) as NSArray
// Since this function is effectively a bridge thunk, use the
// bridge thunk semantics for the NSArray conversion
return _convertNSArrayToArray(nsa)
return nsa as! [String]
}
@@ -418,7 +418,7 @@ extension String {
let nsa = _ns.componentsSeparated(by: separator) as NSArray
// Since this function is effectively a bridge thunk, use the
// bridge thunk semantics for the NSArray conversion
return _convertNSArrayToArray(nsa)
return nsa as! [String]
}
// - (const char *)cStringUsingEncoding:(NSStringEncoding)encoding
@@ -1040,7 +1040,7 @@ extension String {
}
}
return _convertNSArrayToArray(result)
return result as! [String]
}
// - (NSComparisonResult)localizedCaseInsensitiveCompare:(NSString *)aString