From edea94287451330775cf6710fbc92ba0409f1f54 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 23 Feb 2022 23:02:31 +0600 Subject: [PATCH] small refactor of operatons in applyDiff --- .../kotlin/dev/inmo/micro_utils/common/DiffUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt b/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt index 49274f986ed..ab8c6d2ebc6 100644 --- a/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt +++ b/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt @@ -165,10 +165,10 @@ fun MutableList.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) + } }