Skip to content

Commit

Permalink
Merge pull request #360 from InsanusMokrassar/0.20.22
Browse files Browse the repository at this point in the history
0.20.22
  • Loading branch information
InsanusMokrassar authored Dec 14, 2023
2 parents f51b59e + 10e03bb commit c6ed821
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.20.22

* `Common`:
* Add opportunity to create own `Diff` with base constructor

## 0.20.21

* `Resources`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private inline fun <T> getObject(
* @see calculateDiff
*/
@Serializable
data class Diff<T> internal constructor(
data class Diff<T> @Warning(warning) constructor(
val removed: List<@Serializable(IndexedValueSerializer::class) IndexedValue<T>>,
/**
* Old-New values pairs
Expand All @@ -36,6 +36,10 @@ data class Diff<T> internal constructor(
val added: List<@Serializable(IndexedValueSerializer::class) IndexedValue<T>>
) {
fun isEmpty(): Boolean = removed.isEmpty() && replaced.isEmpty() && added.isEmpty()

companion object {
private const val warning = "This feature can be changed without any warranties. Use with caution and only in case you know what you are doing"
}
}

fun <T> emptyDiff(): Diff<T> = Diff(emptyList(), emptyList(), emptyList())
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ crypto_js_version=4.1.1
# Project data

group=dev.inmo
version=0.20.21
android_code_version=227
version=0.20.22
android_code_version=228

0 comments on commit c6ed821

Please sign in to comment.