mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Bridging [aClass] to ObjC in O(1) (redux)
There's no need for a deferred conversion in these cases. This time committing the changes needed to get the validation tests to pass.
This commit is contained in:
@@ -433,8 +433,10 @@ struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
|
||||
_isBridgedToObjectiveC(Element.self),
|
||||
"Array element type is not bridged to Objective-C")
|
||||
if count == 0 {
|
||||
return _SwiftDeferredNSArray(
|
||||
_nativeStorage: _emptyArrayStorage)
|
||||
return _emptyArrayStorage
|
||||
}
|
||||
if _isBridgedVerbatimToObjectiveC(Element.self) {
|
||||
return _storage
|
||||
}
|
||||
return _SwiftDeferredNSArray(_nativeStorage: _storage)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user