mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
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:
2 files changed
+5
-5
No files matched your search
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user