add Diff#isEmpty

This commit is contained in:
InsanusMokrassar 2023-03-07 21:50:23 +06:00
parent d6402c624e
commit 88ee82e1c6

View File

@ -34,7 +34,9 @@ data class Diff<T> internal constructor(
*/
val replaced: List<Pair<@Serializable(IndexedValueSerializer::class) IndexedValue<T>, @Serializable(IndexedValueSerializer::class) IndexedValue<T>>>,
val added: List<@Serializable(IndexedValueSerializer::class) IndexedValue<T>>
)
) {
fun isEmpty(): Boolean = removed.isEmpty() && replaced.isEmpty() && added.isEmpty()
}
fun <T> emptyDiff(): Diff<T> = Diff(emptyList(), emptyList(), emptyList())