projects
/
Sone.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
3202b820196f67fd719fd3c2df0cfcdb7663a729
[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