mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-15 13:29:38 +00:00
hotfixes
This commit is contained in:
@@ -28,7 +28,7 @@ suspend inline fun <K, V> KVCache<K, V>.actualizeAll(
|
|||||||
clear: Boolean = true,
|
clear: Boolean = true,
|
||||||
) {
|
) {
|
||||||
actualizeAll(clear) {
|
actualizeAll(clear) {
|
||||||
repo.getAll { keys(it) }.toMap()
|
repo.getAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ suspend inline fun <K, V> KVCache<K, List<V>>.actualizeAll(
|
|||||||
clear: Boolean = true,
|
clear: Boolean = true,
|
||||||
) {
|
) {
|
||||||
actualizeAll(clear) {
|
actualizeAll(clear) {
|
||||||
repo.getAll { keys(it) }.toMap()
|
repo.getAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,8 +46,6 @@ suspend inline fun <K, V> KVCache<K, V>.actualizeAll(
|
|||||||
clear: Boolean = true,
|
clear: Boolean = true,
|
||||||
) {
|
) {
|
||||||
actualizeAll(clear) {
|
actualizeAll(clear) {
|
||||||
repo.getAllByWithNextPaging {
|
repo.getAll()
|
||||||
getIdsByPagination(it)
|
|
||||||
}.mapNotNull { it to (repo.getById(it) ?: return@mapNotNull null) }.toMap()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -106,9 +106,9 @@ class KeyValueStore<T : Any> internal constructor (
|
|||||||
|
|
||||||
override suspend fun getAll(): Map<String, T> {
|
override suspend fun getAll(): Map<String, T> {
|
||||||
val resultMap = mutableMapOf<String, T>()
|
val resultMap = mutableMapOf<String, T>()
|
||||||
sharedPreferences.all.forEach { (k, v) ->
|
for ((k, v) in sharedPreferences.all) {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
resultMap[k] = (v as? T) ?: return@forEach
|
resultMap[k] = (v as? T) ?: continue
|
||||||
}
|
}
|
||||||
return resultMap.toMap()
|
return resultMap.toMap()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user