Make Configuration.obtained a lazy property

This commit is contained in:
Username404 2021-05-22 16:25:52 +02:00
parent d028baa5d5
commit d33622b850
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 3 deletions

View File

@ -38,8 +38,7 @@ object Configuration {
)
}
}
@JvmField
val obtained: Config = run {
val obtained: Config by lazy {
var result: Config = empty()
with(file) {
if (!exists()) {
@ -64,7 +63,7 @@ object Configuration {
).extract<Config>("Snowy")
}.also {
runBlocking {
writeConfig(it)
writeConfig(it.value)
}
}
val enabledFeatures = mutableMapOf<String, Boolean>().apply {