Created
July 3, 2017 05:32
-
-
Save sitepodmatt/dab8f9d768f549f842702061d84e8f5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Informer<T : Resource>(val blah : Int = 1) { | |
private var started = false | |
fun start(): Boolean { | |
if (!started) { | |
this.started = true | |
return true | |
} else { | |
return false | |
} | |
} | |
fun start2(): Boolean { | |
return if (this.started) false else run { | |
this.started = true | |
true | |
} | |
} | |
fun start3(): Boolean = if (this.started) false else run { | |
this.started = true | |
true | |
} | |
} |
ilya-g
commented
Jul 3, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment