[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:
Dave Abrahams
2016-07-12 18:28:37 -07:00
parent f3aec9358b
commit 7e8158a6f5
4 changed files with 85 additions and 99 deletions

View File

@@ -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)
}