File tree 1 file changed +4
-23
lines changed 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -276,36 +276,17 @@ extension Vector where Element: ~Copyable {
276
276
@_alwaysEmitIntoClient
277
277
public subscript( _ i: Int ) -> Element {
278
278
@_transparent
279
- unsafeAddress {
279
+ _read {
280
280
_precondition ( startIndex <= i && i < endIndex, " Index out of bounds " )
281
281
282
- return address + i
282
+ yield ( ( address + i) . pointee )
283
283
}
284
284
285
285
@_transparent
286
- unsafeMutableAddress {
286
+ _modify {
287
287
_precondition ( startIndex <= i && i < endIndex, " Index out of bounds " )
288
288
289
- return mutableAddress + i
290
- }
291
- }
292
- }
293
-
294
- @available ( SwiftStdlib 6 . 1 , * )
295
- extension Vector where Element: Copyable {
296
- @available ( SwiftStdlib 6 . 1 , * )
297
- @_alwaysEmitIntoClient
298
- public subscript( _ i: Int ) -> Element {
299
- get {
300
- _precondition ( startIndex <= i && i < endIndex, " Index out of bounds " )
301
-
302
- return buffer [ i]
303
- }
304
-
305
- set {
306
- _precondition ( startIndex <= i && i < endIndex, " Index out of bounds " )
307
-
308
- mutableBuffer [ i] = newValue
289
+ yield & ( mutableAddress + i) . pointee
309
290
}
310
291
}
311
292
}
You can’t perform that action at this time.
0 commit comments