From b2df80daead467bf7e6e6fe7ddb8315ac4a147cd Mon Sep 17 00:00:00 2001 From: acclorite Date: Fri, 17 May 2024 18:18:19 +0300 Subject: [PATCH] ForEach -> For loop in customItems, customItemsIndexed (v1.0.1) --- .../book_story/presentation/components/LazyListItem.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/ua/acclorite/book_story/presentation/components/LazyListItem.kt b/app/src/main/java/ua/acclorite/book_story/presentation/components/LazyListItem.kt index d9db96f7..7925c378 100644 --- a/app/src/main/java/ua/acclorite/book_story/presentation/components/LazyListItem.kt +++ b/app/src/main/java/ua/acclorite/book_story/presentation/components/LazyListItem.kt @@ -11,7 +11,7 @@ fun LazyListScope.customItems( key: (T) -> Any?, content: @Composable LazyItemScope.(T) -> Unit ) { - items.forEach { + for (it in items) { item(key = key(it)) { content(it) } @@ -23,7 +23,7 @@ fun LazyListScope.customItemsIndexed( key: (T) -> Any?, content: @Composable LazyItemScope.(Int, T) -> Unit ) { - items.forEachIndexed { index, item -> + for ((index, item) in items.withIndex()) { item(key = key(item)) { content(index, item) } @@ -35,7 +35,7 @@ fun LazyGridScope.customItems( key: (T) -> Any?, content: @Composable LazyGridItemScope.(T) -> Unit ) { - items.forEach { + for (it in items) { item(key = key(it)) { content(it) }