previousSpan(before:maxCount:) ⟹ spanBoundary(before:maxDistance:)

This allows MutableContainers to support mutating iteration backwards without requiring a separate MutableBidirectionalContainer protocol.
This commit is contained in:
Karoy Lorentey committed 2026-07-17 11:50:38 -07:00
1 parent ea581e47e1
commit 99ac14d1fa
9 files changed
+62 -29

No files matched your search

@@ -400,6 +400,11 @@ extension UniqueArray where Element: ~Copyable {
_storage.nextMutableSpan(after: &index, maxCount: maxCount)
}
@_alwaysEmitIntoClient
public func spanBoundary(before index: Index, maxDistance: Int) -> Index? {
_storage.spanBoundary(before: index, maxDistance: maxDistance)
}
@inlinable
@_lifetime(borrow self)
public func previousSpan(