fix potential recompositions

This commit is contained in:
2024-08-04 04:53:00 +03:00
parent c829a7f96a
commit 19fa2c79a8
7 changed files with 10 additions and 13 deletions
@@ -7,10 +7,7 @@ class ImmutableList<T>(val values: List<T>) : Iterable<T> {
constructor(size: Int, init: (index: Int) -> T) : this(MutableList(size, init))
operator fun get(index: Int): T? {
values.singleOrNull()
return values[index]
}
operator fun get(index: Int): T = values[index]
inline fun forEach(action: (T) -> Unit) {
for (element in values) action(element)