mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
[DequeModule] Assorted UniqueDeque doc string fixes
This commit is contained in:
4 files changed
+17
-16
No files matched your search
@@ -427,7 +427,7 @@ extension RigidDeque /*where Element: Copyable*/ {
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
/// Copies the elements of a borrowing sequence to the end of this deque.
|
||||
/// Copies the elements of a borrowing sequence to the front of this deque.
|
||||
///
|
||||
/// If the deque does not have sufficient capacity to hold all items in the
|
||||
/// sequence, then this triggers a runtime error.
|
||||
@@ -443,7 +443,7 @@ extension RigidDeque /*where Element: Copyable*/ {
|
||||
self._prepend(copying: items)
|
||||
}
|
||||
|
||||
/// Copies the elements of a borrowing sequence to the end of this deque.
|
||||
/// Copies the elements of a borrowing sequence to the front of this deque.
|
||||
///
|
||||
/// If the deque does not have sufficient capacity to hold all items in the
|
||||
/// sequence, then this triggers a runtime error.
|
||||
@@ -459,7 +459,7 @@ extension RigidDeque /*where Element: Copyable*/ {
|
||||
self._prepend(copying: items, exactCount: items.count)
|
||||
}
|
||||
|
||||
/// Copies the elements of a container to the end of this deque.
|
||||
/// Copies the elements of a container to the front of this deque.
|
||||
///
|
||||
/// If the deque does not have sufficient capacity to hold all items in the
|
||||
/// sequence, then this triggers a runtime error.
|
||||
@@ -475,7 +475,7 @@ extension RigidDeque /*where Element: Copyable*/ {
|
||||
self._prepend(copying: items, exactCount: items.count)
|
||||
}
|
||||
|
||||
/// Copies the elements of a container to the end of this deque.
|
||||
/// Copies the elements of a container to the front of this deque.
|
||||
///
|
||||
/// If the deque does not have sufficient capacity to hold all items in the
|
||||
/// sequence, then this triggers a runtime error.
|
||||
|
||||
@@ -83,7 +83,6 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
///
|
||||
/// - Parameter consumer: A function taking an input span of the removed items,
|
||||
/// allowing them to be consumed straight out of the deque's storage.
|
||||
/// The function is called at most once.
|
||||
/// - Complexity: O(`self.count`)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
|
||||
@@ -259,7 +259,7 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueDeque /*where Element: Copyable*/ {
|
||||
/// Copies the elements of a buffer and prepend them to the front of this
|
||||
/// rigid deque.
|
||||
/// deque.
|
||||
///
|
||||
/// If the deque doesn't have sufficient capacity to accommodate the specified
|
||||
/// number of new elements, then this method reallocates the deque's storage
|
||||
@@ -396,13 +396,14 @@ extension UniqueDeque /*where Element: Copyable*/ {
|
||||
/// Prepend the elements of a sequence to the front of this deque by copying
|
||||
/// them.
|
||||
///
|
||||
/// If the deque does not have sufficient capacity to hold all items in the
|
||||
/// sequence, then this triggers a runtime error.
|
||||
/// If the deque does not have sufficient capacity to accommodate the new
|
||||
/// elements, then this method reallocates the deque's storage to grow it,
|
||||
/// using a geometric growth rate.
|
||||
///
|
||||
/// This example prepends the elements of a `Range<Int>` instance
|
||||
/// to a rigid deque of integers.
|
||||
/// to a unique deque of integers.
|
||||
///
|
||||
/// var numbers = RigidDeque<Int>(capacity: 10)
|
||||
/// var numbers = UniqueDeque<Int>()
|
||||
/// numbers.append(copying: [1, 2, 3, 4, 5])
|
||||
/// numbers.prepend(copying: 10...15)
|
||||
/// // `numbers` now contains [10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5]
|
||||
@@ -433,13 +434,14 @@ extension UniqueDeque /*where Element: Copyable*/ {
|
||||
/// Prepend the elements of a collection to the front of this deque by copying
|
||||
/// them.
|
||||
///
|
||||
/// If the deque does not have sufficient capacity to hold all items in the
|
||||
/// sequence, then this triggers a runtime error.
|
||||
/// If the deque does not have sufficient capacity to accommodate the new
|
||||
/// elements, then this method reallocates the deque's storage to grow it,
|
||||
/// using a geometric growth rate.
|
||||
///
|
||||
/// This example prepends the elements of a `Range<Int>` instance
|
||||
/// to a rigid deque of integers.
|
||||
/// to a unique deque of integers.
|
||||
///
|
||||
/// var numbers = RigidDeque<Int>(capacity: 10)
|
||||
/// var numbers = UniqueDeque<Int>()
|
||||
/// numbers.append(copying: [1, 2, 3, 4, 5])
|
||||
/// numbers.prepend(copying: 10...15)
|
||||
/// // `numbers` now contains [10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5]
|
||||
|
||||
@@ -308,10 +308,10 @@ extension UniqueDeque {
|
||||
UniqueDeque(_storage: _storage.clone())
|
||||
}
|
||||
|
||||
/// Copy the contents of this deque into a newly allocated rigid deque
|
||||
/// Copy the contents of this deque into a newly allocated unique deque
|
||||
/// instance with the specified capacity.
|
||||
///
|
||||
/// - Parameter capacity: The desired capacity of the resulting rigid deque.
|
||||
/// - Parameter capacity: The desired capacity of the resulting unique deque.
|
||||
/// `capacity` must be greater than or equal to `count`.
|
||||
///
|
||||
/// - Complexity: O(`count`)
|
||||
|
||||
Reference in new issue
Block a user