From e41e6b9205ac86cfa8f8dde02e5fe1f5c48636de Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 6 Feb 2023 15:59:13 +0100 Subject: [PATCH] Fix bug. n+1 items were created. --- .../roomlist/model/RoomListRoomSummaryPlaceholders.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/roomlist/src/main/kotlin/io/element/android/features/roomlist/model/RoomListRoomSummaryPlaceholders.kt b/features/roomlist/src/main/kotlin/io/element/android/features/roomlist/model/RoomListRoomSummaryPlaceholders.kt index 5e6176bcb2..5fb3221093 100644 --- a/features/roomlist/src/main/kotlin/io/element/android/features/roomlist/model/RoomListRoomSummaryPlaceholders.kt +++ b/features/roomlist/src/main/kotlin/io/element/android/features/roomlist/model/RoomListRoomSummaryPlaceholders.kt @@ -33,8 +33,8 @@ object RoomListRoomSummaryPlaceholders { fun createFakeList(size: Int): List { return mutableListOf().apply { - for (i in 0..size) { - add(create("\$fakeRoom$i")) + repeat(size) { + add(create("\$fakeRoom$it")) } } }