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 {
83
83
let result = _ContiguousArrayBuffer < AnyObject > (
84
84
_uninitializedCount: boundsCount,
85
85
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
+ }
92
93
93
94
return _SliceBuffer ( _buffer: result, shiftedToStartIndex: bounds. lowerBound)
94
95
}
You can’t perform that action at this time.
0 commit comments