<@U3T6LDWTD> I thought about this, but this is 4 l...
# language-proposals
l
@benleggiero I thought about this, but this is 4 lines versus two lines for the "ugly" approach
b
Copy code
fun BluetoothAdapter.isOffOrTurningOff(): Boolean = when (state) {
        BluetoothAdapter.STATE_OFF, BluetoothAdapter.STATE_TURNING_OFF -> true
        else -> false
    }
l
Yep, better, but still one extra line 😉 I think I'll stick with the ugly approach until Kotlin comes with a better syntax. For longer lines though, the when statement is my choice #1 too 😉