Skip to content

Commit c39216d

Browse files
author
Tim Vermeulen
committed
usableFromInline -> inlinable
1 parent 051b60c commit c39216d

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
@@ -149,7 +149,7 @@ public struct EvenChunks<Base: Collection> {
149149
@usableFromInline
150150
internal var firstUpperBound: Base.Index
151151

152-
@usableFromInline
152+
@inlinable
153153
internal init(
154154
base: Base,
155155
numberOfChunks: Int,
@@ -162,7 +162,7 @@ public struct EvenChunks<Base: Collection> {
162162
self.firstUpperBound = firstUpperBound
163163
}
164164

165-
@usableFromInline
165+
@inlinable
166166
internal init(base: Base, numberOfChunks: Int) {
167167
self.base = base
168168
self.numberOfChunks = numberOfChunks
@@ -178,41 +178,41 @@ public struct EvenChunks<Base: Collection> {
178178
extension EvenChunks {
179179
/// Returns the number of chunks with size `smallChunkSize + 1` at the start
180180
/// of this collection.
181-
@usableFromInline
181+
@inlinable
182182
internal var numberOfLargeChunks: Int {
183183
baseCount % numberOfChunks
184184
}
185185

186186
/// Returns the size of the small chunks at the end of this collection.
187-
@usableFromInline
187+
@inlinable
188188
internal var smallChunkSize: Int {
189189
baseCount / numberOfChunks
190190
}
191191

192192
/// Returns the size of a chunk at a given offset.
193-
@usableFromInline
193+
@inlinable
194194
internal func sizeOfChunk(offset: Int) -> Int {
195195
let isLargeChunk = offset < numberOfLargeChunks
196196
return baseCount / numberOfChunks + (isLargeChunk ? 1 : 0)
197197
}
198198

199199
/// Returns the index in the base collection of the end of the chunk starting
200200
/// at the given index.
201-
@usableFromInline
201+
@inlinable
202202
internal func endOfChunk(startingAt start: Base.Index, offset: Int) -> Base.Index {
203203
base.index(start, offsetBy: sizeOfChunk(offset: offset))
204204
}
205205

206206
/// Returns the index in the base collection of the start of the chunk ending
207207
/// at the given index.
208-
@usableFromInline
208+
@inlinable
209209
internal func startOfChunk(endingAt end: Base.Index, offset: Int) -> Base.Index {
210210
base.index(end, offsetBy: -sizeOfChunk(offset: offset))
211211
}
212212

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

222222
/// Returns the index that corresponds to the chunk that ends at the given
223223
/// base index.
224-
@usableFromInline
224+
@inlinable
225225
internal func indexOfChunk(endingAt end: Base.Index, offset: Int) -> Index {
226226
let start = startOfChunk(endingAt: end, offset: offset)
227227
return Index(start..<end, offset: offset)
@@ -239,7 +239,7 @@ public struct EvenChunksIndex<Base: Comparable>: Comparable {
239239
@usableFromInline
240240
internal var offset: Int
241241

242-
@usableFromInline
242+
@inlinable
243243
internal init(_ baseRange: Range<Base>, offset: Int) {
244244
self.baseRange = baseRange
245245
self.offset = offset

0 commit comments

Comments
 (0)