Make Configuration.obtained a lazy property
This commit is contained in:
		
							parent
							
								
									d028baa5d5
								
							
						
					
					
						commit
						d33622b850
					
				@ -38,8 +38,7 @@ object Configuration {
 | 
				
			|||||||
            )
 | 
					            )
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    @JvmField
 | 
					    val obtained: Config by lazy {
 | 
				
			||||||
    val obtained: Config = run {
 | 
					 | 
				
			||||||
        var result: Config = empty()
 | 
					        var result: Config = empty()
 | 
				
			||||||
        with(file) {
 | 
					        with(file) {
 | 
				
			||||||
            if (!exists()) {
 | 
					            if (!exists()) {
 | 
				
			||||||
@ -64,7 +63,7 @@ object Configuration {
 | 
				
			|||||||
        ).extract<Config>("Snowy")
 | 
					        ).extract<Config>("Snowy")
 | 
				
			||||||
    }.also {
 | 
					    }.also {
 | 
				
			||||||
        runBlocking {
 | 
					        runBlocking {
 | 
				
			||||||
            writeConfig(it)
 | 
					            writeConfig(it.value)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    val enabledFeatures = mutableMapOf<String, Boolean>().apply {
 | 
					    val enabledFeatures = mutableMapOf<String, Boolean>().apply {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user