1
0

Evaluate arg to Boolean.option lazily

This commit is contained in:
Andrew Waterman 2016-09-06 23:36:41 -07:00
parent a0dcd42e80
commit 511cc6c5c5

View File

@ -30,7 +30,7 @@ object Util {
def toInt: Int = if (x) 1 else 0 def toInt: Int = if (x) 1 else 0
// this one's snagged from scalaz // this one's snagged from scalaz
def option[T](z: T): Option[T] = if (x) Some(z) else None def option[T](z: => T): Option[T] = if (x) Some(z) else None
} }
} }