ForEach -> For loop in customItems, customItemsIndexed (v1.0.1)

This commit is contained in:
acclorite 2024-05-17 18:18:19 +03:00
parent 62eeca017f
commit b2df80daea

View file

@ -11,7 +11,7 @@ fun <T> LazyListScope.customItems(
key: (T) -> Any?, key: (T) -> Any?,
content: @Composable LazyItemScope.(T) -> Unit content: @Composable LazyItemScope.(T) -> Unit
) { ) {
items.forEach { for (it in items) {
item(key = key(it)) { item(key = key(it)) {
content(it) content(it)
} }
@ -23,7 +23,7 @@ fun <T> LazyListScope.customItemsIndexed(
key: (T) -> Any?, key: (T) -> Any?,
content: @Composable LazyItemScope.(Int, T) -> Unit content: @Composable LazyItemScope.(Int, T) -> Unit
) { ) {
items.forEachIndexed { index, item -> for ((index, item) in items.withIndex()) {
item(key = key(item)) { item(key = key(item)) {
content(index, item) content(index, item)
} }
@ -35,7 +35,7 @@ fun <T> LazyGridScope.customItems(
key: (T) -> Any?, key: (T) -> Any?,
content: @Composable LazyGridItemScope.(T) -> Unit content: @Composable LazyGridItemScope.(T) -> Unit
) { ) {
items.forEach { for (it in items) {
item(key = key(it)) { item(key = key(it)) {
content(it) content(it)
} }