Skip to content

Commit 47a62c0

Browse files
authored
Merge pull request #25714 from Catfish-Man/cant-read
Revert "[stdlib] AutoreleasingUnsafeMutablePointer: Switch subscripts to _read accessors"
2 parents 2538ae3 + 460a521 commit 47a62c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

stdlib/public/core/BridgeObjectiveC.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,10 @@ public struct AutoreleasingUnsafeMutablePointer<Pointee /* TODO : class */>
374374
/// `Pointee`.
375375
@inlinable
376376
public var pointee: Pointee {
377-
@_transparent _read {
377+
/// Retrieve the value the pointer points to.
378+
@_transparent get {
378379
// We can do a strong load normally.
379-
yield UnsafePointer(self).pointee
380+
return UnsafePointer(self).pointee
380381
}
381382
/// Set the value the pointer points to, copying over the previous value.
382383
///
@@ -413,9 +414,9 @@ public struct AutoreleasingUnsafeMutablePointer<Pointee /* TODO : class */>
413414
@inlinable // unsafe-performance
414415
public subscript(i: Int) -> Pointee {
415416
@_transparent
416-
_read {
417+
get {
417418
// We can do a strong load normally.
418-
yield ((UnsafePointer<Pointee>(self) + i).pointee)
419+
return (UnsafePointer<Pointee>(self) + i).pointee
419420
}
420421
}
421422

0 commit comments

Comments
 (0)