projects
/
Sone.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add helper for booleans
[Sone.git]
/
src
/
main
/
kotlin
/
net
/
pterodactylus
/
sone
/
utils
/
Booleans.kt
1
package net.pterodactylus.sone.utils
2
3
/**
4
* Returns the value of [block] if `this` is true, returns `null` otherwise.
5
*/
6
fun <R> Boolean.ifTrue(block: () -> R): R? = if (this) block() else null