mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
Update MutableContainer
- Add `nextMutableSpan(after:)` and `nextMutableSpan(after:maxCount:limitedBy)`, replacing `nextMutableSpan(after:maxCount:)` as the core access primitives - Add `previousMutableSpan` default algorithms on bidirectional mutable containers
This commit is contained in:
12 files changed
+350
-192
No files matched your search
@@ -403,9 +403,9 @@ extension UniqueArray where Element: ~Copyable {
|
||||
@inlinable
|
||||
@_lifetime(&self)
|
||||
public mutating func nextMutableSpan(
|
||||
after index: inout Int, maxCount: Int
|
||||
after index: inout Int, maxCount: Int, limitedBy limit: Int
|
||||
) -> MutableSpan<Element> {
|
||||
_storage.nextMutableSpan(after: &index, maxCount: maxCount)
|
||||
_storage.nextMutableSpan(after: &index, maxCount: maxCount, limitedBy: limit)
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
|
||||
@@ -33,7 +33,10 @@ extension UniqueArray where Element: ~Copyable {
|
||||
public mutating func nextMutableSpan(
|
||||
after index: inout Int, maximumCount: Int
|
||||
) -> MutableSpan<Element> {
|
||||
self.nextMutableSpan(after: &index, maxCount: maximumCount)
|
||||
self.nextMutableSpan(
|
||||
after: &index,
|
||||
maxCount: maximumCount,
|
||||
limitedBy: self.endIndex)
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "previousSpan(before:maxCount:)")
|
||||
|
||||
Reference in new issue
Block a user