mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
[BasicContainers] Enable APIs scheduled to ship in 1.5.0
- `RigidArray.nextMutableSpan(after:maximumCount:)` - `UniqueArray.nextMutableSpan(after:maximumCount:)` - `RigidDeque.nextMutableSpan(after:maximumCount:)` - `UniqueDeque.nextMutableSpan(after:maximumCount:)` - `UniqueArray.init(minimumCapacity:)` (replacing `.init(capacity:)`) - `UniqueDeque.init(minimumCapacity:)` (replacing `.init(capacity:)`) - `RigidDeque.index(before:)` - `UniqueDeque.index(before:)` - `RigidDeque.formIndex(before:)` - `UniqueDeque.formIndex(before:)`
This commit is contained in:
11 files changed
+39
-35
No files matched your search
@@ -357,7 +357,6 @@ extension UniqueArray where Element: ~Copyable {
|
||||
_storage.nextSpan(after: &index, maximumCount: maximumCount)
|
||||
}
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW // FIXME: Enable unconditionally in 1.5.0
|
||||
@inlinable
|
||||
@_lifetime(&self)
|
||||
public mutating func nextMutableSpan(
|
||||
@@ -373,7 +372,6 @@ extension UniqueArray where Element: ~Copyable {
|
||||
) -> Span<Element> {
|
||||
_storage.previousSpan(before: &index, maximumCount: maximumCount)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -15,6 +15,13 @@
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
/// Initializes a new unique array with the specified capacity and no elements.
|
||||
@available(*, deprecated, renamed: "init(minimumCapacity:)")
|
||||
@inlinable
|
||||
public init(capacity: Int) {
|
||||
self.init(minimumCapacity: capacity)
|
||||
}
|
||||
|
||||
/// Append a given number of items to the end of this array by populating
|
||||
/// an output span.
|
||||
///
|
||||
|
||||
@@ -26,19 +26,11 @@ extension UniqueArray where Element: ~Copyable {
|
||||
_storage = .init(capacity: 0)
|
||||
}
|
||||
|
||||
/// Initializes a new unique array with the specified capacity and no elements.
|
||||
@inlinable
|
||||
public init(capacity: Int) {
|
||||
_storage = .init(capacity: capacity)
|
||||
}
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW // FIXME: Enable unconditionally in 1.5.0
|
||||
/// Initializes a new unique array with the specified capacity and no elements.
|
||||
@inlinable
|
||||
public init(minimumCapacity: Int) {
|
||||
_storage = .init(capacity: minimumCapacity)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
|
||||
Reference in new issue
Block a user