mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
Introduce Container.nextSpan(after:maxCount:limitedBy:) and make it the core Container primitive
This commit is contained in:
13 files changed
+290
-252
No files matched your search
@@ -387,17 +387,17 @@ extension UniqueArray where Element: ~Copyable {
|
||||
@inlinable
|
||||
@_lifetime(borrow self)
|
||||
public func nextSpan(
|
||||
after index: inout Int, maxCount: Int
|
||||
after index: inout Int
|
||||
) -> Span<Element> {
|
||||
_storage.nextSpan(after: &index, maxCount: maxCount)
|
||||
_storage.nextSpan(after: &index)
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@_lifetime(borrow self)
|
||||
public func nextSpan(
|
||||
after index: inout Int, limitedBy limit: Int?
|
||||
after index: inout Int, maxCount: Int, limitedBy limit: Int
|
||||
) -> Span<Element> {
|
||||
_storage.nextSpan(after: &index, limitedBy: limit)
|
||||
_storage.nextSpan(after: &index, maxCount: maxCount, limitedBy: limit)
|
||||
}
|
||||
|
||||
@inlinable
|
||||
|
||||
@@ -21,7 +21,10 @@ extension UniqueArray where Element: ~Copyable {
|
||||
public func nextSpan(
|
||||
after index: inout Int, maximumCount: Int
|
||||
) -> Span<Element> {
|
||||
self.nextSpan(after: &index, maxCount: maximumCount)
|
||||
self.nextSpan(
|
||||
after: &index,
|
||||
maxCount: maximumCount,
|
||||
limitedBy: self.endIndex)
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "nextMutableSpan(after:maxCount:)")
|
||||
|
||||
Reference in new issue
Block a user