From 88ee82e1c62ce9df2f900ef8c253febc4fc1c7a0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 7 Mar 2023 21:50:23 +0600 Subject: [PATCH] add Diff#isEmpty --- .../kotlin/dev/inmo/micro_utils/common/DiffUtils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 e93bc3488de..167c94a21fd 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 @@ -34,7 +34,9 @@ data class Diff internal constructor( */ val replaced: List, @Serializable(IndexedValueSerializer::class) IndexedValue>>, val added: List<@Serializable(IndexedValueSerializer::class) IndexedValue> -) +) { + fun isEmpty(): Boolean = removed.isEmpty() && replaced.isEmpty() && added.isEmpty() +} fun emptyDiff(): Diff = Diff(emptyList(), emptyList(), emptyList())