kv rework, fixes in map keyvalue repo, tests

This commit is contained in:
2022-06-03 22:33:26 +06:00
parent bcb0e42fa2
commit eaa143f7d7
20 changed files with 814 additions and 23 deletions

View File

@@ -78,11 +78,11 @@ class WriteMapKeyValueRepo<Key, Value>(
}
override suspend fun unsetWithValues(toUnset: List<Value>) {
map.forEach {
if (it.value in toUnset) {
map.remove(it.key)
_onValueRemoved.emit(it.key)
}
map.mapNotNull { (k, v) ->
k.takeIf { v in toUnset }
}.forEach {
map.remove(it)
_onValueRemoved.emit(it)
}
}
}