mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-17 13:53:49 +00:00
applyDiff: Diff
This commit is contained in:
parent
60bdb59d71
commit
59428140a8
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 0.12.15
|
## 0.12.15
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `applyDiff` will return `Diff` object since this release
|
||||||
* `Coroutines`:
|
* `Coroutines`:
|
||||||
* Add `Flow` extensions `flatMap`, `flatMapNotNull` and `flatten`
|
* Add `Flow` extensions `flatMap`, `flatMapNotNull` and `flatten`
|
||||||
* Add `Flow` extensions `takeNotNull` and `filterNotNull`
|
* Add `Flow` extensions `takeNotNull` and `filterNotNull`
|
||||||
|
@ -173,7 +173,7 @@ inline fun <T> Iterable<T>.calculateStrictDiff(
|
|||||||
fun <T> MutableList<T>.applyDiff(
|
fun <T> MutableList<T>.applyDiff(
|
||||||
source: Iterable<T>,
|
source: Iterable<T>,
|
||||||
strictComparison: Boolean = false
|
strictComparison: Boolean = false
|
||||||
) = calculateDiff(source, strictComparison).let {
|
): Diff<T> = calculateDiff(source, strictComparison).also {
|
||||||
for (i in it.removed.indices.sortedDescending()) {
|
for (i in it.removed.indices.sortedDescending()) {
|
||||||
removeAt(it.removed[i].index)
|
removeAt(it.removed[i].index)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user