Use .apply on the Configuration.enabledFeatures mutable map
This commit is contained in:
parent
1106b8bdae
commit
772e665904
|
@ -70,9 +70,11 @@ object Configuration {
|
||||||
writeConfig(it)
|
writeConfig(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val enabledFeatures: MutableMap<String, Boolean> = if (obtained.hasPath("enabledFeatures")) {
|
val enabledFeatures = mutableMapOf<String, Boolean>().apply {
|
||||||
obtained.extract("enabledFeatures")
|
if (obtained.hasPath("enabledFeatures")) {
|
||||||
} else mutableMapOf()
|
putAll(obtained.extract("enabledFeatures"))
|
||||||
|
}
|
||||||
|
}
|
||||||
val macros: MutableSet<Macro> = run {
|
val macros: MutableSet<Macro> = run {
|
||||||
if (!macroFile.exists()) macroFile.createNewFile()
|
if (!macroFile.exists()) macroFile.createNewFile()
|
||||||
macroFile.readLines(Charset.forName("UTF-8")).map {
|
macroFile.readLines(Charset.forName("UTF-8")).map {
|
||||||
|
|
Loading…
Reference in New Issue