diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Append.swift b/Sources/BasicContainers/RigidArray/RigidArray+Append.swift index 57e64641..96608c54 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Append.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Append.swift @@ -62,7 +62,7 @@ extension RigidArray where Element: ~Copyable { /// /// - Parameters /// - uninitializedCount: The number of items to append to the array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is allowed to initialize fewer than `uninitializedCount` items. /// The array is appended however many items the callback adds to @@ -91,9 +91,13 @@ extension RigidArray where Element: ~Copyable { /// If the array does not have sufficient capacity to store the new items in /// the buffer, then this triggers a runtime error. /// + /// If the callback fails to fully populate its output span or if + /// it throws an error, then the items that were successfully initialized + /// still get appended to the end of the array. + /// /// - Parameters /// - count: The number of items to append to the array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is allowed to initialize fewer than `count` items. The array is /// appended however many items the callback adds to the output span diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift b/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift index 1cb76faa..4f001442 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Initializers.swift @@ -47,7 +47,7 @@ extension RigidArray where Element: ~Copyable { /// /// - Parameters: /// - capacity: The storage capacity of the new array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is allowed to add fewer than `capacity` items. The array is /// initialized with however many items the callback adds to the diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift b/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift index aa83b767..47018162 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Insertions.swift @@ -66,7 +66,7 @@ extension RigidArray where Element: ~Copyable { /// - count: The number of items to insert into the array. /// - index: The position at which to insert the new items. /// `index` must be a valid index in the array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is called with an empty output span of capacity matching the /// supplied count, and it must fully populate it before returning. diff --git a/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift b/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift index 9c32a1b6..19a0744a 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray+Replacements.swift @@ -42,7 +42,7 @@ extension RigidArray where Element: ~Copyable { /// - subrange: The subrange of the array to replace. The bounds of /// the range must be valid indices in the array. /// - newCount: the number of items to replace the old subrange. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is called with an empty output span of capacity `newCount`, /// and it must fully populate it before returning. diff --git a/Sources/BasicContainers/RigidArray/RigidArray.swift b/Sources/BasicContainers/RigidArray/RigidArray.swift index 2c5d2b67..4f13a871 100644 --- a/Sources/BasicContainers/RigidArray/RigidArray.swift +++ b/Sources/BasicContainers/RigidArray/RigidArray.swift @@ -196,7 +196,7 @@ extension RigidArray where Element: ~Copyable { extension RigidArray where Element: ~Copyable { /// Arbitrarily edit the storage underlying this array by invoking a /// user-supplied closure with a mutable `OutputSpan` view over it. - /// This method calls its function argument precisely once, allowing it to + /// This method calls its function argument at most once, allowing it to /// arbitrarily modify the contents of the output span it is given. /// The argument is free to add, remove or reorder any items; however, /// it is not allowed to replace the span or change its capacity. @@ -207,7 +207,7 @@ extension RigidArray where Element: ~Copyable { /// /// - Parameter body: A function that edits the contents of this array through /// an `OutputSpan` argument. This method invokes this function - /// precisely once. + /// at most once. /// - Returns: This method returns the result of its function argument. /// - Complexity: Adds O(1) overhead to the complexity of the function /// argument. diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift index 6843b9ab..999c7384 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Append.swift @@ -45,7 +45,7 @@ extension UniqueArray where Element: ~Copyable { /// /// - Parameters /// - count: The number of items to append to the array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is allowed to initialize fewer than `count` items. The array is /// appended however many items the callback adds to the output span diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift index 106790fc..fd18c8d1 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Initializers.swift @@ -38,7 +38,7 @@ extension UniqueArray where Element: ~Copyable { /// /// - Parameters: /// - capacity: The storage capacity of the new array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is allowed to add fewer than `capacity` items. The array is /// initialized with however many items the callback adds to the diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift index 8180b00c..c5cd3475 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Insertions.swift @@ -62,7 +62,7 @@ extension UniqueArray where Element: ~Copyable { /// - count: The number of items to insert into the array. /// - index: The position at which to insert the new items. /// `index` must be a valid index in the array. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is called with an empty output span of capacity matching the /// supplied count, and it must fully populate it before returning. diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift b/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift index f2b85f0e..3eac8b2b 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray+Replacements.swift @@ -43,7 +43,7 @@ extension UniqueArray where Element: ~Copyable { /// - subrange: The subrange of the array to replace. The bounds of /// the range must be valid indices in the array. /// - newCount: the number of items to replace the old subrange. - /// - body: A callback that gets called precisely once to directly + /// - body: A callback that gets called at most once to directly /// populate newly reserved storage within the array. The function /// is called with an empty output span of capacity `newCount`, /// and it must fully populate it before returning. diff --git a/Sources/BasicContainers/UniqueArray/UniqueArray.swift b/Sources/BasicContainers/UniqueArray/UniqueArray.swift index 081e07c3..3f99cc7b 100644 --- a/Sources/BasicContainers/UniqueArray/UniqueArray.swift +++ b/Sources/BasicContainers/UniqueArray/UniqueArray.swift @@ -128,7 +128,7 @@ extension UniqueArray where Element: ~Copyable { extension UniqueArray where Element: ~Copyable { /// Arbitrarily edit the storage underlying this array by invoking a /// user-supplied closure with a mutable `OutputSpan` view over it. - /// This method calls its function argument precisely once, allowing it to + /// This method calls its function argument at most once, allowing it to /// arbitrarily modify the contents of the output span it is given. /// The argument is free to add, remove or reorder any items; however, /// it is not allowed to replace the span or change its capacity. @@ -139,7 +139,7 @@ extension UniqueArray where Element: ~Copyable { /// /// - Parameter body: A function that edits the contents of this array through /// an `OutputSpan` argument. This method invokes this function - /// precisely once. + /// at most once. /// - Returns: This method returns the result of its function argument. /// - Complexity: Adds O(1) overhead to the complexity of the function /// argument. diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift index 3d37b48e..e569b630 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Insertions.swift @@ -74,7 +74,7 @@ extension RigidDeque where Element: ~Copyable { /// times to initialize each successive chunk of storage. However, invocations /// cease if the callback fails to fully populate its output span or if /// it throws an error. In such cases, the deque keeps all items that were - /// successfully initialized before the callback terminated the prepend. + /// successfully initialized before the callback terminated the insertion. /// /// Partial insertions create a gap in ring buffer storage that needs to be /// closed by moving already inserted items to their correct positions given