mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 21:27:37 +00:00
Minor CachedValue fix
This commit is contained in:
parent
25c64db0a1
commit
c30be20e49
@ -8,9 +8,7 @@ class CachedValue<T>(private val factory: () -> T) : Lazy<T> {
|
||||
get() {
|
||||
val local = _val
|
||||
return local ?: synchronized(this) {
|
||||
val newInstance = factory()
|
||||
_val = newInstance
|
||||
newInstance
|
||||
_val ?: factory().also { _val = it }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user