mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user