mirror of
https://github.com/InvertGeek/MixFile.git
synced 2026-06-01 17:10:49 +08:00
Update CachedMutableValue.kt
This commit is contained in:
@@ -58,14 +58,12 @@ inline fun <reified T, reified C : Iterable<T>> cachedMutableOf(value: C, key: S
|
||||
}
|
||||
},
|
||||
getter@{
|
||||
var result = value
|
||||
errorDialog("读取数据失败 key=${key}") {
|
||||
if (kv.containsKey(key)) {
|
||||
val json: C = kv.decodeString(key)?.parseJsonObject() ?: value
|
||||
result = json
|
||||
}
|
||||
if (!kv.containsKey(key)) {
|
||||
return@getter value
|
||||
}
|
||||
return@getter result
|
||||
errorDialog("读取数据失败 key=${key}") {
|
||||
kv.decodeString(key)?.parseJsonObject()
|
||||
} ?: value
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user