File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
grid/src/commonMain/kotlin/com/cheonjaeung/compose/grid Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,14 @@ package com.cheonjaeung.compose.grid
22
33import kotlin.math.max
44
5+ /* *
6+ * Returns a new [IntArray] with specified [size] filled with 0.
7+ */
8+ @Suppress(" NOTHING_TO_INLINE" )
9+ internal inline fun intArrayOfZeros (size : Int ): IntArray {
10+ return IntArray (size) { 0 }
11+ }
12+
513/* *
614 * Returns a new [MutableList] with specified [size] filled with `null`.
715 */
Original file line number Diff line number Diff line change @@ -255,10 +255,10 @@ private class HorizontalVerticalGridMeasureHelper(
255255 val crossAxisCount = measureResult.crossAxisCount
256256 val mainAxisLayoutSize = measureResult.mainAxisLayoutSize
257257 val crossAxisLayoutSize = measureResult.crossAxisLayoutSize
258- val mainAxisPositions = IntArray (mainAxisCount) { 0 }
259- val crossAxisPositions = IntArray (crossAxisCount) { 0 }
258+ val mainAxisPositions = intArrayOfZeros (mainAxisCount)
259+ val crossAxisPositions = intArrayOfZeros (crossAxisCount)
260260
261- val mainAxisBiggestChildrenSizes = IntArray (mainAxisCount) { 0 }
261+ val mainAxisBiggestChildrenSizes = intArrayOfZeros (mainAxisCount)
262262 for (m in 0 until mainAxisCount) {
263263 val currentLinePlaceables = placeableMeasureInfoTable[m]
264264 val currentLineChildrenSizes = IntArray (currentLinePlaceables.size) { index ->
You can’t perform that action at this time.
0 commit comments