@@ -149,7 +149,7 @@ public struct EvenChunks<Base: Collection> {
149
149
@usableFromInline
150
150
internal var firstUpperBound : Base . Index
151
151
152
- @usableFromInline
152
+ @inlinable
153
153
internal init (
154
154
base: Base ,
155
155
numberOfChunks: Int ,
@@ -162,7 +162,7 @@ public struct EvenChunks<Base: Collection> {
162
162
self . firstUpperBound = firstUpperBound
163
163
}
164
164
165
- @usableFromInline
165
+ @inlinable
166
166
internal init ( base: Base , numberOfChunks: Int ) {
167
167
self . base = base
168
168
self . numberOfChunks = numberOfChunks
@@ -178,41 +178,41 @@ public struct EvenChunks<Base: Collection> {
178
178
extension EvenChunks {
179
179
/// Returns the number of chunks with size `smallChunkSize + 1` at the start
180
180
/// of this collection.
181
- @usableFromInline
181
+ @inlinable
182
182
internal var numberOfLargeChunks : Int {
183
183
baseCount % numberOfChunks
184
184
}
185
185
186
186
/// Returns the size of the small chunks at the end of this collection.
187
- @usableFromInline
187
+ @inlinable
188
188
internal var smallChunkSize : Int {
189
189
baseCount / numberOfChunks
190
190
}
191
191
192
192
/// Returns the size of a chunk at a given offset.
193
- @usableFromInline
193
+ @inlinable
194
194
internal func sizeOfChunk( offset: Int ) -> Int {
195
195
let isLargeChunk = offset < numberOfLargeChunks
196
196
return baseCount / numberOfChunks + ( isLargeChunk ? 1 : 0 )
197
197
}
198
198
199
199
/// Returns the index in the base collection of the end of the chunk starting
200
200
/// at the given index.
201
- @usableFromInline
201
+ @inlinable
202
202
internal func endOfChunk( startingAt start: Base . Index , offset: Int ) -> Base . Index {
203
203
base. index ( start, offsetBy: sizeOfChunk ( offset: offset) )
204
204
}
205
205
206
206
/// Returns the index in the base collection of the start of the chunk ending
207
207
/// at the given index.
208
- @usableFromInline
208
+ @inlinable
209
209
internal func startOfChunk( endingAt end: Base . Index , offset: Int ) -> Base . Index {
210
210
base. index ( end, offsetBy: - sizeOfChunk( offset: offset) )
211
211
}
212
212
213
213
/// Returns the index that corresponds to the chunk that starts at the given
214
214
/// base index.
215
- @usableFromInline
215
+ @inlinable
216
216
internal func indexOfChunk( startingAt start: Base . Index , offset: Int ) -> Index {
217
217
guard offset != numberOfChunks else { return endIndex }
218
218
let end = endOfChunk ( startingAt: start, offset: offset)
@@ -221,7 +221,7 @@ extension EvenChunks {
221
221
222
222
/// Returns the index that corresponds to the chunk that ends at the given
223
223
/// base index.
224
- @usableFromInline
224
+ @inlinable
225
225
internal func indexOfChunk( endingAt end: Base . Index , offset: Int ) -> Index {
226
226
let start = startOfChunk ( endingAt: end, offset: offset)
227
227
return Index ( start..< end, offset: offset)
@@ -239,7 +239,7 @@ public struct EvenChunksIndex<Base: Comparable>: Comparable {
239
239
@usableFromInline
240
240
internal var offset : Int
241
241
242
- @usableFromInline
242
+ @inlinable
243
243
internal init ( _ baseRange: Range < Base > , offset: Int ) {
244
244
self . baseRange = baseRange
245
245
self . offset = offset
0 commit comments