Coverage Summary for Class: ReplaceKt (com.vsevolodganin.clicktrack.utils.collection.immutable)
Class | Class, % | Method, % | Branch, % | Line, % | Instruction, % |
---|---|---|---|---|---|
ReplaceKt | 0% (0/1) | 0% (0/1) | 0% (0/6) | 0% (0/4) | 0% (0/34) |
package com.vsevolodganin.clicktrack.utils.collection.immutable
fun <T> List<T>.replace(index: Int, map: (T) -> T): List<T> {
if (index !in indices) return this
return toMutableList().apply {
this[index] = map(this[index])
}
}