[Analysis API] cleanup code

This commit is contained in:
Ilya Kirillov
2022-06-15 17:27:57 +02:00
parent 37b0c20879
commit d716c68f0e
8 changed files with 58 additions and 56 deletions
@@ -589,10 +589,8 @@ internal class KtSymbolByFirBuilder constructor(
}
private class BuilderCache<From, To : Any> private constructor(
private val cache: ConcurrentMap<From, To>,
) {
constructor() : this(ContainerUtil.createConcurrentSoftMap())
private class BuilderCache<From, To : Any> {
private val cache = ContainerUtil.createConcurrentSoftMap<From, To>()
inline fun <reified S : To> cache(key: From, calculation: () -> S): S {
val value = cache.getOrPut(key, calculation)
@@ -27,7 +27,7 @@ internal open class KtFirDelegatingScope(
getPossibleCallableNames() + getPossibleClassifierNames()
}
override fun getAllPossibleNames(): Set<Name> = withValidityAssertion { withValidityAssertion { allNamesCached } }
override fun getAllPossibleNames(): Set<Name> = withValidityAssertion { allNamesCached }
override fun getPossibleCallableNames(): Set<Name> = withValidityAssertion {
firScope.getCallableNames()