small refactor of operatons in applyDiff

This commit is contained in:
InsanusMokrassar 2022-02-23 23:02:31 +06:00
parent 8a8f568b9a
commit edea942874

View File

@ -165,10 +165,10 @@ fun <T> MutableList<T>.applyDiff(
for (i in it.removed.indices.sortedDescending()) {
removeAt(it.removed[i].index)
}
it.replaced.forEach { (_, new) ->
set(new.index, new.value)
}
it.added.forEach { (i, t) ->
add(i, t)
}
it.replaced.forEach { (_, new) ->
set(new.index, new.value)
}
}