This commit is contained in:
2023-03-10 18:43:43 +06:00
parent eeebbff70d
commit 5180d6fc3e
2 changed files with 5 additions and 7 deletions

View File

@@ -106,9 +106,9 @@ class KeyValueStore<T : Any> internal constructor (
override suspend fun getAll(): Map<String, T> {
val resultMap = mutableMapOf<String, T>()
sharedPreferences.all.forEach { (k, v) ->
for ((k, v) in sharedPreferences.all) {
@Suppress("UNCHECKED_CAST")
resultMap[k] = (v as? T) ?: return@forEach
resultMap[k] = (v as? T) ?: continue
}
return resultMap.toMap()
}