mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-15 00:27:25 +00:00
Minor CachedValue fix
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user