@@ -27,7 +27,7 @@ public struct LazyChunked<Base: Collection, Subject> {
27
27
@usableFromInline
28
28
internal var firstUpperBound : Base . Index
29
29
30
- @usableFromInline
30
+ @inlinable
31
31
internal init (
32
32
base: Base ,
33
33
projection: @escaping ( Base . Element ) -> Subject ,
@@ -51,7 +51,7 @@ extension LazyChunked: LazyCollectionProtocol {
51
51
@usableFromInline
52
52
internal var baseRange : Range < Base . Index >
53
53
54
- @usableFromInline
54
+ @inlinable
55
55
internal init ( _ baseRange: Range < Base . Index > ) {
56
56
self . baseRange = baseRange
57
57
}
@@ -72,7 +72,7 @@ extension LazyChunked: LazyCollectionProtocol {
72
72
73
73
/// Returns the index in the base collection of the end of the chunk starting
74
74
/// at the given index.
75
- @usableFromInline
75
+ @inlinable
76
76
internal func endOfChunk( startingAt start: Base . Index ) -> Base . Index {
77
77
let subject = projection ( base [ start] )
78
78
return base [ base. index ( after: start) ... ]
@@ -112,7 +112,7 @@ extension LazyChunked: BidirectionalCollection
112
112
{
113
113
/// Returns the index in the base collection of the start of the chunk ending
114
114
/// at the given index.
115
- @usableFromInline
115
+ @inlinable
116
116
internal func startOfChunk( endingAt end: Base . Index ) -> Base . Index {
117
117
let indexBeforeEnd = base. index ( before: end)
118
118
@@ -174,7 +174,7 @@ extension Collection {
174
174
/// predicate.
175
175
///
176
176
/// - Complexity: O(*n*), where *n* is the length of this collection.
177
- @usableFromInline
177
+ @inlinable
178
178
internal func chunked< Subject> (
179
179
on projection: ( Element ) throws -> Subject ,
180
180
by belongInSameGroup: ( Subject , Subject ) throws -> Bool
@@ -273,7 +273,7 @@ extension ChunkedByCount: Collection {
273
273
@usableFromInline
274
274
internal let baseRange : Range < Base . Index >
275
275
276
- @usableFromInline
276
+ @inlinable
277
277
internal init ( _baseRange: Range < Base . Index > ) {
278
278
self . baseRange = _baseRange
279
279
}
@@ -290,6 +290,7 @@ extension ChunkedByCount: Collection {
290
290
}
291
291
292
292
/// - Complexity: O(1)
293
+ @inlinable
293
294
public subscript( i: Index ) -> Element {
294
295
precondition ( i < endIndex, " Index out of range " )
295
296
return base [ i. baseRange]
@@ -392,7 +393,7 @@ extension ChunkedByCount {
392
393
return index
393
394
}
394
395
395
- @usableFromInline
396
+ @inlinable
396
397
internal func offsetForward(
397
398
_ i: Index , offsetBy distance: Int , limit: Index ? = nil
398
399
) -> Index ? {
@@ -406,8 +407,8 @@ extension ChunkedByCount {
406
407
}
407
408
408
409
// Convenience to compute offset backward base distance.
409
- @inline ( __always )
410
- private func computeOffsetBackwardBaseDistance(
410
+ @inlinable
411
+ internal func computeOffsetBackwardBaseDistance(
411
412
_ i: Index , _ distance: Int
412
413
) -> Int {
413
414
if i == endIndex {
@@ -423,7 +424,7 @@ extension ChunkedByCount {
423
424
return distance * chunkCount
424
425
}
425
426
426
- @usableFromInline
427
+ @inlinable
427
428
internal func offsetBackward(
428
429
_ i: Index , offsetBy distance: Int , limit: Index ? = nil
429
430
) -> Index ? {
@@ -438,8 +439,8 @@ extension ChunkedByCount {
438
439
}
439
440
440
441
// Helper to compute index(offsetBy:) index.
441
- @inline ( __always )
442
- private func makeOffsetIndex(
442
+ @inlinable
443
+ internal func makeOffsetIndex(
443
444
from i: Index , baseBound: Base . Index , distance: Int , baseDistance: Int ,
444
445
limit: Index ? , by limitFn: ( Base . Index , Base . Index ) -> Bool
445
446
) -> Index ? {
0 commit comments