Adjust use of @_transparent

Avoid using `@inlinable @_transparent` — the `@_transparent` attribute already implies inlinability, although evidently without the `@usableFromInline` parts. (`internal @_transparent` functions aren’t allowed to be called from inlinable functions.)

`@usableFromInline @_transparent` or `@_alwaysEmitIntoClient @_transparent` expresses the author’s intention better, making the choice of exposing a symbol explicit.
This commit is contained in:
Karoy Lorentey committed 2025-08-26 14:03:16 -07:00
1 parent 66c49374ab
commit 39dc431dbc
2 files changed
+5 -5

No files matched your search

@@ -69,7 +69,7 @@ extension DynamicArray where Element: ~Copyable {
extension DynamicArray where Element: ~Copyable {
@available(SwiftStdlib 5.0, *)
@inlinable
@_alwaysEmitIntoClient
@_transparent
internal mutating func _edit<R: ~Copyable>(
freeCapacity: Int,
+4 -4
View File
@@ -258,7 +258,7 @@ extension DynamicArray where Element: ~Copyable {
//MARK: - Resizing
@inlinable
@_alwaysEmitIntoClient
@_transparent
internal func _growDynamicArrayCapacity(_ capacity: Int) -> Int {
2 * capacity
@@ -275,14 +275,14 @@ extension DynamicArray where Element: ~Copyable {
_storage.reserveCapacity(n)
}
@inlinable
@_alwaysEmitIntoClient
@_transparent
public mutating func _ensureFreeCapacity(_ freeCapacity: Int) {
internal mutating func _ensureFreeCapacity(_ freeCapacity: Int) {
guard _storage.freeCapacity < freeCapacity else { return }
_ensureFreeCapacitySlow(freeCapacity)
}
@inlinable
@_alwaysEmitIntoClient
@_transparent
internal func _grow(freeCapacity: Int) -> Int {
Swift.max(