mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
More adjustments
This commit is contained in:
22 files changed
+383
-379
No files matched your search
@@ -21,7 +21,7 @@ extension Deque: RandomAccessContainer {
|
||||
|
||||
@available(SwiftCompatibilitySpan 5.0, *)
|
||||
@lifetime(borrow self)
|
||||
public func span(following index: inout Int, maximumCount: Int) -> Span<Element> {
|
||||
_storage.value.span(following: &index, maximumCount: maximumCount)
|
||||
public func nextSpan(after index: inout Int, maximumCount: Int) -> Span<Element> {
|
||||
_storage.value.nextSpan(after: &index, maximumCount: maximumCount)
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,8 @@ extension DynamicDeque: @unchecked Sendable where Element: Sendable & ~Copyable
|
||||
extension DynamicDeque: RandomAccessContainer where Element: ~Copyable {
|
||||
@available(SwiftCompatibilitySpan 5.0, *)
|
||||
@lifetime(borrow self)
|
||||
public func span(following index: inout Int, maximumCount: Int) -> Span<Element> {
|
||||
_storage.span(following: &index, maximumCount: maximumCount)
|
||||
public func nextSpan(after index: inout Int, maximumCount: Int) -> Span<Element> {
|
||||
_storage.nextSpan(after: &index, maximumCount: maximumCount)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,15 +82,15 @@ extension RigidDeque where Element: ~Copyable {
|
||||
extension RigidDeque: RandomAccessContainer, MutableContainer where Element: ~Copyable {
|
||||
@inlinable
|
||||
@lifetime(borrow self)
|
||||
public func span(following index: inout Int, maximumCount: Int) -> Span<Element> {
|
||||
public func nextSpan(after index: inout Int, maximumCount: Int) -> Span<Element> {
|
||||
let slots = _handle.slotRange(following: &index, maximumCount: maximumCount)
|
||||
return _span(over: slots)
|
||||
}
|
||||
|
||||
@inlinable
|
||||
@lifetime(&self)
|
||||
public mutating func mutableSpan(
|
||||
following index: inout Int, maximumCount: Int
|
||||
public mutating func nextMutableSpan(
|
||||
after index: inout Int, maximumCount: Int
|
||||
) -> MutableSpan<Element> {
|
||||
let slots = _handle.slotRange(following: &index, maximumCount: maximumCount)
|
||||
return _mutableSpan(over: slots)
|
||||
|
||||
Reference in new issue
Block a user