mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-30 04:48:43 +00:00
Making base properties on collection wrappers all internal (#85)
This commit is contained in:
1 parent
198eee004e
commit
a61c3db4fb
8 files changed
+27
-14
No files matched your search
@@ -14,10 +14,12 @@ public struct Chain2<Base1: Sequence, Base2: Sequence>
|
||||
where Base1.Element == Base2.Element
|
||||
{
|
||||
/// The first sequence in this chain.
|
||||
public let base1: Base1
|
||||
@usableFromInline
|
||||
internal let base1: Base1
|
||||
|
||||
/// The second sequence in this chain.
|
||||
public let base2: Base2
|
||||
@usableFromInline
|
||||
internal let base2: Base2
|
||||
|
||||
@inlinable
|
||||
internal init(base1: Base1, base2: Base2) {
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
/// predicate or projection.
|
||||
public struct LazyChunked<Base: Collection, Subject> {
|
||||
/// The collection that this instance provides a view onto.
|
||||
public let base: Base
|
||||
@usableFromInline
|
||||
internal let base: Base
|
||||
|
||||
/// The projection function.
|
||||
@usableFromInline
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
/// A collection wrapper that generates combinations of a base collection.
|
||||
public struct Combinations<Base: Collection> {
|
||||
/// The collection to iterate over for combinations.
|
||||
public let base: Base
|
||||
@usableFromInline
|
||||
internal let base: Base
|
||||
|
||||
@usableFromInline
|
||||
internal let baseCount: Int
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
/// A collection wrapper that repeats the elements of a base collection.
|
||||
public struct Cycle<Base: Collection> {
|
||||
/// The collection to repeat.
|
||||
public let base: Base
|
||||
@usableFromInline
|
||||
internal let base: Base
|
||||
|
||||
@inlinable
|
||||
internal init(base: Base) {
|
||||
@@ -24,10 +25,10 @@ extension Cycle: Sequence {
|
||||
/// The iterator for a `Cycle` sequence.
|
||||
public struct Iterator: IteratorProtocol {
|
||||
@usableFromInline
|
||||
let base: Base
|
||||
internal let base: Base
|
||||
|
||||
@usableFromInline
|
||||
var current: Base.Index
|
||||
internal var current: Base.Index
|
||||
|
||||
@inlinable
|
||||
internal init(base: Base) {
|
||||
|
||||
@@ -16,7 +16,8 @@ public struct Indexed<Base: Collection> {
|
||||
public typealias Element = (index: Base.Index, element: Base.Element)
|
||||
|
||||
/// The base collection.
|
||||
public let base: Base
|
||||
@usableFromInline
|
||||
internal let base: Base
|
||||
|
||||
@inlinable
|
||||
internal init(base: Base) {
|
||||
|
||||
@@ -78,7 +78,8 @@ extension MutableCollection
|
||||
/// A sequence of all the permutations of a collection's elements.
|
||||
public struct Permutations<Base: Collection> {
|
||||
/// The base collection to iterate over for permutations.
|
||||
public let base: Base
|
||||
@usableFromInline
|
||||
internal let base: Base
|
||||
|
||||
@usableFromInline
|
||||
internal let baseCount: Int
|
||||
@@ -137,7 +138,7 @@ extension Permutations: Sequence {
|
||||
/// The iterator for a `Permutations` instance.
|
||||
public struct Iterator: IteratorProtocol {
|
||||
@usableFromInline
|
||||
internal var base: Base
|
||||
internal let base: Base
|
||||
|
||||
@usableFromInline
|
||||
internal let baseCount: Int
|
||||
|
||||
@@ -12,9 +12,12 @@
|
||||
/// A sequence that represents the product of two sequences' elements.
|
||||
public struct Product2<Base1: Sequence, Base2: Collection> {
|
||||
/// The outer sequence in the product.
|
||||
public let base1: Base1
|
||||
@usableFromInline
|
||||
internal let base1: Base1
|
||||
|
||||
/// The inner sequence in the product.
|
||||
public let base2: Base2
|
||||
@usableFromInline
|
||||
internal let base2: Base2
|
||||
|
||||
@inlinable
|
||||
internal init(_ base1: Base1, _ base2: Base2) {
|
||||
|
||||
@@ -47,8 +47,11 @@ extension Collection {
|
||||
/// A collection wrapper that presents a sliding window over the elements of
|
||||
/// a collection.
|
||||
public struct Windows<Base: Collection> {
|
||||
public let base: Base
|
||||
public let size: Int
|
||||
@usableFromInline
|
||||
internal let base: Base
|
||||
|
||||
@usableFromInline
|
||||
internal let size: Int
|
||||
|
||||
@usableFromInline
|
||||
internal var firstUpperBound: Base.Index?
|
||||
|
||||
Reference in new issue
Block a user