Skip to content

Commit cb7e3d5

Browse files
authored
Merge pull request #24655 from stephentyrone/accelerate-buffer-inlinable
2 parents 9d30bf5 + d5819c9 commit cb7e3d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

stdlib/public/Darwin/Accelerate/AccelerateBuffer.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public protocol AccelerateBuffer {
2626
/// Calls a closure with a pointer to the object's contiguous storage.
2727
func withUnsafeBufferPointer<R>(
2828
_ body: (UnsafeBufferPointer<Element>) throws -> R
29-
) rethrows -> R
29+
) rethrows -> R
3030
}
3131

3232
/// A mutable object composed of count elements that are stored contiguously
@@ -40,23 +40,25 @@ public protocol AccelerateMutableBuffer: AccelerateBuffer {
4040
/// contiguous storage.
4141
mutating func withUnsafeMutableBufferPointer<R>(
4242
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R
43-
) rethrows -> R
43+
) rethrows -> R
4444
}
4545

4646
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
4747
public extension AccelerateBuffer where Self: Collection {
48+
@inlinable
4849
func withUnsafeBufferPointer<R>(
4950
_ body: (UnsafeBufferPointer<Element>) throws -> R
50-
) rethrows -> R {
51+
) rethrows -> R {
5152
return try withContiguousStorageIfAvailable(body)!
5253
}
5354
}
5455

5556
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
5657
extension AccelerateMutableBuffer where Self: MutableCollection {
58+
@inlinable
5759
public mutating func withUnsafeMutableBufferPointer<R>(
5860
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R
59-
) rethrows -> R {
61+
) rethrows -> R {
6062
return try withContiguousMutableStorageIfAvailable(body)!
6163
}
6264
}

0 commit comments

Comments
 (0)