mirror of
https://github.com/apple/swift-collections
synced 2026-11-29 05:14:20 +00:00
IterableIterator_ → BorrowingIterator_
This commit is contained in:
36 files changed
+86
-86
No files matched your search
@@ -21,7 +21,7 @@ import ContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueSet: Iterable_ where Element: ~Copyable {
|
||||
public typealias Element_ = Element
|
||||
public typealias IterableIterator_ = RigidSet<Element>.IterableIterator_
|
||||
public typealias BorrowingIterator_ = RigidSet<Element>.BorrowingIterator_
|
||||
|
||||
@inlinable
|
||||
public var underestimatedCount_: Int { count }
|
||||
@@ -35,8 +35,8 @@ extension UniqueSet: Iterable_ where Element: ~Copyable {
|
||||
|
||||
@inlinable
|
||||
@_lifetime(borrow self)
|
||||
public borrowing func makeIterableIterator_() -> IterableIterator_ {
|
||||
IterableIterator_(_set: _storage)
|
||||
public borrowing func makeBorrowingIterator_() -> BorrowingIterator_ {
|
||||
BorrowingIterator_(_set: _storage)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -139,7 +139,7 @@ extension UniqueSet /* where Element: Copyable */ {
|
||||
) throws(S.Failure_)
|
||||
where S.Element_ == Element {
|
||||
_ensureFreeCapacity(items.underestimatedCount_)
|
||||
var it = items.makeIterableIterator_()
|
||||
var it = items.makeBorrowingIterator_()
|
||||
while true {
|
||||
let span = try it.nextSpan_()
|
||||
guard !span.isEmpty else { break }
|
||||
|
||||
Reference in new issue
Block a user