@@ -154,7 +154,7 @@ public struct EvenChunks<Base: Collection> {
154
154
@usableFromInline
155
155
internal var firstUpperBound : Base . Index
156
156
157
- @usableFromInline
157
+ @inlinable
158
158
internal init (
159
159
base: Base ,
160
160
numberOfChunks: Int ,
@@ -167,7 +167,7 @@ public struct EvenChunks<Base: Collection> {
167
167
self . firstUpperBound = firstUpperBound
168
168
}
169
169
170
- @usableFromInline
170
+ @inlinable
171
171
internal init ( base: Base , numberOfChunks: Int ) {
172
172
self . base = base
173
173
self . numberOfChunks = numberOfChunks
@@ -183,41 +183,41 @@ public struct EvenChunks<Base: Collection> {
183
183
extension EvenChunks {
184
184
/// Returns the number of chunks with size `smallChunkSize + 1` at the start
185
185
/// of this collection.
186
- @usableFromInline
186
+ @inlinable
187
187
internal var numberOfLargeChunks : Int {
188
188
baseCount % numberOfChunks
189
189
}
190
190
191
191
/// Returns the size of the small chunks at the end of this collection.
192
- @usableFromInline
192
+ @inlinable
193
193
internal var smallChunkSize : Int {
194
194
baseCount / numberOfChunks
195
195
}
196
196
197
197
/// Returns the size of a chunk at a given offset.
198
- @usableFromInline
198
+ @inlinable
199
199
internal func sizeOfChunk( offset: Int ) -> Int {
200
200
let isLargeChunk = offset < numberOfLargeChunks
201
201
return baseCount / numberOfChunks + ( isLargeChunk ? 1 : 0 )
202
202
}
203
203
204
204
/// Returns the index in the base collection of the end of the chunk starting
205
205
/// at the given index.
206
- @usableFromInline
206
+ @inlinable
207
207
internal func endOfChunk( startingAt start: Base . Index , offset: Int ) -> Base . Index {
208
208
base. index ( start, offsetBy: sizeOfChunk ( offset: offset) )
209
209
}
210
210
211
211
/// Returns the index in the base collection of the start of the chunk ending
212
212
/// at the given index.
213
- @usableFromInline
213
+ @inlinable
214
214
internal func startOfChunk( endingAt end: Base . Index , offset: Int ) -> Base . Index {
215
215
base. index ( end, offsetBy: - sizeOfChunk( offset: offset) )
216
216
}
217
217
218
218
/// Returns the index that corresponds to the chunk that starts at the given
219
219
/// base index.
220
- @usableFromInline
220
+ @inlinable
221
221
internal func indexOfChunk( startingAt start: Base . Index , offset: Int ) -> Index {
222
222
guard offset != numberOfChunks else { return endIndex }
223
223
let end = endOfChunk ( startingAt: start, offset: offset)
@@ -226,7 +226,7 @@ extension EvenChunks {
226
226
227
227
/// Returns the index that corresponds to the chunk that ends at the given
228
228
/// base index.
229
- @usableFromInline
229
+ @inlinable
230
230
internal func indexOfChunk( endingAt end: Base . Index , offset: Int ) -> Index {
231
231
let start = startOfChunk ( endingAt: end, offset: offset)
232
232
return Index ( start..< end, offset: offset)
@@ -244,7 +244,7 @@ public struct EvenChunksIndex<Base: Comparable>: Comparable {
244
244
@usableFromInline
245
245
internal var offset : Int
246
246
247
- @usableFromInline
247
+ @inlinable
248
248
internal init ( _ baseRange: Range < Base > , offset: Int ) {
249
249
self . baseRange = baseRange
250
250
self . offset = offset
0 commit comments