[Analysis API] fix possible leaks of FirDeclarations from cache keys in KtSymbolByFirBuilder
If some FirDeclarations is inaccessible then there is no reason to store KtSymbol for it ^KTIJ-22749
This commit is contained in:
+1
-1
@@ -608,7 +608,7 @@ internal class KtSymbolByFirBuilder constructor(
|
||||
|
||||
|
||||
private class BuilderCache<From, To : KtSymbol> {
|
||||
private val cache = ContainerUtil.createConcurrentSoftMap<From, To>()
|
||||
private val cache = ContainerUtil.createWeakKeySoftValueMap<From, To>()
|
||||
|
||||
inline fun <reified S : To> cache(key: From, calculation: () -> S): S {
|
||||
val value = cache.getOrPut(key, calculation)
|
||||
|
||||
Reference in New Issue
Block a user