mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
Renaming BorrowingSequence_ to Iterable_
This commit is contained in:
1 parent
232e6aeacf
commit
4bda43f4a9
53 files changed
+197
-197
No files matched your search
@@ -19,9 +19,9 @@ import ContainersPreview
|
||||
#if compiler(>=6.4) && UnstableHashedContainers && UnstableContainersPreview
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueSet: BorrowingSequence_ where Element: ~Copyable {
|
||||
extension UniqueSet: Iterable_ where Element: ~Copyable {
|
||||
public typealias Element_ = Element
|
||||
public typealias BorrowingIterator_ = RigidSet<Element>.BorrowingIterator_
|
||||
public typealias IterableIterator_ = RigidSet<Element>.IterableIterator_
|
||||
|
||||
@inlinable
|
||||
public var underestimatedCount_: Int { count }
|
||||
@@ -35,8 +35,8 @@ extension UniqueSet: BorrowingSequence_ where Element: ~Copyable {
|
||||
|
||||
@inlinable
|
||||
@_lifetime(borrow self)
|
||||
public borrowing func makeBorrowingIterator_() -> BorrowingIterator_ {
|
||||
BorrowingIterator_(_set: _storage)
|
||||
public borrowing func makeIterableIterator_() -> IterableIterator_ {
|
||||
IterableIterator_(_set: _storage)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -77,7 +77,7 @@ extension UniqueSet where Element: Copyable {
|
||||
#if UnstableContainersPreview
|
||||
@_alwaysEmitIntoClient
|
||||
public init<
|
||||
S: BorrowingSequence_<Element> & ~Copyable & ~Escapable
|
||||
S: Iterable_<Element> & ~Copyable & ~Escapable
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
@@ -95,7 +95,7 @@ extension UniqueSet where Element: Copyable {
|
||||
#if UnstableContainersPreview
|
||||
@_alwaysEmitIntoClient
|
||||
public init<
|
||||
S: BorrowingSequence_<Element> & Sequence<Element>
|
||||
S: Iterable_<Element> & Sequence<Element>
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
|
||||
@@ -132,12 +132,12 @@ extension UniqueSet /* where Element: Copyable */ {
|
||||
#if UnstableContainersPreview
|
||||
@_alwaysEmitIntoClient
|
||||
package mutating func _insert<
|
||||
S: BorrowingSequence_<Element> & ~Copyable & ~Escapable
|
||||
S: Iterable_<Element> & ~Copyable & ~Escapable
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
_ensureFreeCapacity(items.underestimatedCount_)
|
||||
var it = items.makeBorrowingIterator_()
|
||||
var it = items.makeIterableIterator_()
|
||||
while true {
|
||||
let span = it.nextSpan_()
|
||||
guard !span.isEmpty else { break }
|
||||
@@ -150,7 +150,7 @@ extension UniqueSet /* where Element: Copyable */ {
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func insert<
|
||||
S: BorrowingSequence_<Element> & ~Copyable & ~Escapable
|
||||
S: Iterable_<Element> & ~Copyable & ~Escapable
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
@@ -172,7 +172,7 @@ extension UniqueSet /* where Element: Copyable */ {
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func insert<
|
||||
S: BorrowingSequence_<Element> & Sequence<Element>
|
||||
S: Iterable_<Element> & Sequence<Element>
|
||||
>(
|
||||
copying items: borrowing S
|
||||
) {
|
||||
|
||||
Reference in new issue
Block a user