mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
Add second parameter to Container.makeBorrowingIterator(from:to:)
This commit is contained in:
13 files changed
+140
-81
No files matched your search
@@ -40,12 +40,10 @@ extension RigidArray: Container where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@_lifetime(borrow self)
|
||||
public func makeBorrowingIterator(
|
||||
from start: Index
|
||||
from start: Index, to end: Index
|
||||
) -> BorrowingIterator_ {
|
||||
let span = self.span
|
||||
let it = span.makeBorrowingIterator(from: start)
|
||||
// FIXME: `it` is borrowing `span`, not self
|
||||
return _overrideLifetime(it, borrowing: self)
|
||||
// FIXME: `makeBorrowingIterator` would be borrowing the temporary `span`, not self
|
||||
self.span._makeBorrowingIterator(from: start, to: end)
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
|
||||
@@ -40,9 +40,9 @@ extension UniqueArray: Container where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
@_lifetime(borrow self)
|
||||
public func makeBorrowingIterator(
|
||||
from start: Index
|
||||
from start: Index, to end: Index
|
||||
) -> BorrowingIterator_ {
|
||||
_storage.makeBorrowingIterator(from: start)
|
||||
_storage.makeBorrowingIterator(from: start, to: end)
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
|
||||
Reference in new issue
Block a user