File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -83,12 +83,13 @@ internal struct _CocoaArrayWrapper: RandomAccessCollection {
8383 let result = _ContiguousArrayBuffer < AnyObject > (
8484 _uninitializedCount: boundsCount,
8585 minimumCapacity: 0 )
86-
87- // Tell Cocoa to copy the objects into our storage
88- core. getObjects (
89- UnsafeMutableRawPointer ( result. firstElementAddress)
90- . assumingMemoryBound ( to: AnyObject . self) ,
91- range: _SwiftNSRange ( location: bounds. lowerBound, length: boundsCount) )
86+
87+ let base = UnsafeMutableRawPointer ( result. firstElementAddress)
88+ . assumingMemoryBound ( to: AnyObject . self)
89+
90+ for idx in 0 ..< boundsCount {
91+ ( base + idx) . initialize ( to: core. objectAt ( idx + bounds. lowerBound) )
92+ }
9293
9394 return _SliceBuffer ( _buffer: result, shiftedToStartIndex: bounds. lowerBound)
9495 }
You can’t perform that action at this time.
0 commit comments