mirror of
https://github.com/apple/swift-collections
synced 2026-11-29 05:14:20 +00:00
[BasicContainers] RigidArray, UniqueArray: “precisely once” → “at most once”
Loosen guarantees about how many times closure arguments are getting called, so that e.g. insertions of zero items do not necessarily need to call their callback with an empty OutputSpan. (For these array types we can reinstate the guarantee later, if it turns out to be important/useful. However, the generalized primitives will need to allow their callbacks to get called an arbitrary number of times, and it seems useful to establish that (at least partially) with these simple array types too.)
This commit is contained in:
11 files changed
+18
-14
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user