FirResolution: store enabled value in field with initial reading from component
Before this commit, we read/wrote 'enabled' directly from PropertiesComponent. Now we do only initial reading and then store modified value in field. This should make 'enabled' reading faster.
This commit is contained in:
@@ -12,9 +12,16 @@ object FirResolution {
|
||||
private const val ENABLED_BY_DEFAULT = false
|
||||
private const val optionName = "kotlin.use.fir.resolution"
|
||||
|
||||
private val initialEnabledValue: Boolean by lazy {
|
||||
PropertiesComponent.getInstance().getBoolean(optionName, ENABLED_BY_DEFAULT)
|
||||
}
|
||||
|
||||
private var changedEnabledValue: Boolean? = null
|
||||
|
||||
var enabled: Boolean
|
||||
get() = PropertiesComponent.getInstance().getBoolean(optionName, ENABLED_BY_DEFAULT)
|
||||
get() = changedEnabledValue ?: initialEnabledValue
|
||||
set(value) {
|
||||
PropertiesComponent.getInstance().setValue(optionName, value, ENABLED_BY_DEFAULT)
|
||||
changedEnabledValue = value
|
||||
//PropertiesComponent.getInstance().setValue(optionName, value, ENABLED_BY_DEFAULT)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user