FIR IDE: Mark FirTowerDataContextCollector as ThreadSafeMutableState
Also, use HashMap instead of LinkedHashMap in `FirTowerDataContextCollector`
This commit is contained in:
+3
-1
@@ -5,14 +5,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.fir.low.level.api.element.builder
|
||||
|
||||
import org.jetbrains.kotlin.fir.ThreadSafeMutableState
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||
import org.jetbrains.kotlin.fir.psi
|
||||
import org.jetbrains.kotlin.fir.resolve.FirTowerDataContext
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
|
||||
@ThreadSafeMutableState
|
||||
class FirTowerDataContextCollector {
|
||||
private val state: MutableMap<KtElement, FirTowerDataContext> = mutableMapOf()
|
||||
private val state: MutableMap<KtElement, FirTowerDataContext> = hashMapOf()
|
||||
|
||||
fun addStatementContext(statement: FirStatement, context: FirTowerDataContext) {
|
||||
(statement.psi as? KtElement)?.let { state[it] = context }
|
||||
|
||||
Reference in New Issue
Block a user