Skip to content

Commit

Permalink
Minor code style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
smyrgeorge committed May 15, 2024
1 parent d466240 commit ead7986
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ suspend fun <A> Iterable<A>.forEachParallel(context: CoroutineContext = Dispatch
fun <T> Iterable<T>.chunked(total: Int, chunks: Int): List<List<T>> =
chunked(chunkSize(total, chunks))

fun chunkSize(size: Int, chunks: Int): Int =
if (chunks > size) size else size / chunks
private fun chunkSize(total: Int, chunks: Int): Int =
if (total == 0) 1 else if (chunks > total) total else total / chunks

0 comments on commit ead7986

Please sign in to comment.