[Low Level FIR] fix CME in java enhancement
Now all computations in FirThreadSafeCache are performed under lock ^KTIJ-23081 fixed
This commit is contained in:
+1
-1
@@ -19,6 +19,6 @@ internal inline fun <KEY : Any, RESULT> ConcurrentMap<KEY, Any>.getOrPutWithNull
|
|||||||
key: KEY,
|
key: KEY,
|
||||||
crossinline compute: (KEY) -> Any?
|
crossinline compute: (KEY) -> Any?
|
||||||
): RESULT {
|
): RESULT {
|
||||||
val value = getOrPut(key) { compute(key) ?: NullValue }
|
val value = computeIfAbsent(key) { compute(key) ?: NullValue }
|
||||||
return value.nullValueToNull()
|
return value.nullValueToNull()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user