Skip to content

Commit 93eabb4

Browse files
author
Tim Vermeulen
committed
usableFromInline -> inlinable
1 parent 93fea86 commit 93eabb4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Sources/Algorithms/Chunked.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public struct EvenChunks<Base: Collection> {
154154
@usableFromInline
155155
internal var firstUpperBound: Base.Index
156156

157-
@usableFromInline
157+
@inlinable
158158
internal init(
159159
base: Base,
160160
numberOfChunks: Int,
@@ -167,7 +167,7 @@ public struct EvenChunks<Base: Collection> {
167167
self.firstUpperBound = firstUpperBound
168168
}
169169

170-
@usableFromInline
170+
@inlinable
171171
internal init(base: Base, numberOfChunks: Int) {
172172
self.base = base
173173
self.numberOfChunks = numberOfChunks
@@ -183,41 +183,41 @@ public struct EvenChunks<Base: Collection> {
183183
extension EvenChunks {
184184
/// Returns the number of chunks with size `smallChunkSize + 1` at the start
185185
/// of this collection.
186-
@usableFromInline
186+
@inlinable
187187
internal var numberOfLargeChunks: Int {
188188
baseCount % numberOfChunks
189189
}
190190

191191
/// Returns the size of the small chunks at the end of this collection.
192-
@usableFromInline
192+
@inlinable
193193
internal var smallChunkSize: Int {
194194
baseCount / numberOfChunks
195195
}
196196

197197
/// Returns the size of a chunk at a given offset.
198-
@usableFromInline
198+
@inlinable
199199
internal func sizeOfChunk(offset: Int) -> Int {
200200
let isLargeChunk = offset < numberOfLargeChunks
201201
return baseCount / numberOfChunks + (isLargeChunk ? 1 : 0)
202202
}
203203

204204
/// Returns the index in the base collection of the end of the chunk starting
205205
/// at the given index.
206-
@usableFromInline
206+
@inlinable
207207
internal func endOfChunk(startingAt start: Base.Index, offset: Int) -> Base.Index {
208208
base.index(start, offsetBy: sizeOfChunk(offset: offset))
209209
}
210210

211211
/// Returns the index in the base collection of the start of the chunk ending
212212
/// at the given index.
213-
@usableFromInline
213+
@inlinable
214214
internal func startOfChunk(endingAt end: Base.Index, offset: Int) -> Base.Index {
215215
base.index(end, offsetBy: -sizeOfChunk(offset: offset))
216216
}
217217

218218
/// Returns the index that corresponds to the chunk that starts at the given
219219
/// base index.
220-
@usableFromInline
220+
@inlinable
221221
internal func indexOfChunk(startingAt start: Base.Index, offset: Int) -> Index {
222222
guard offset != numberOfChunks else { return endIndex }
223223
let end = endOfChunk(startingAt: start, offset: offset)
@@ -226,7 +226,7 @@ extension EvenChunks {
226226

227227
/// Returns the index that corresponds to the chunk that ends at the given
228228
/// base index.
229-
@usableFromInline
229+
@inlinable
230230
internal func indexOfChunk(endingAt end: Base.Index, offset: Int) -> Index {
231231
let start = startOfChunk(endingAt: end, offset: offset)
232232
return Index(start..<end, offset: offset)
@@ -244,7 +244,7 @@ public struct EvenChunksIndex<Base: Comparable>: Comparable {
244244
@usableFromInline
245245
internal var offset: Int
246246

247-
@usableFromInline
247+
@inlinable
248248
internal init(_ baseRange: Range<Base>, offset: Int) {
249249
self.baseRange = baseRange
250250
self.offset = offset

0 commit comments

Comments
 (0)