Evaluate arg to Boolean.option lazily
This commit is contained in:
parent
a0dcd42e80
commit
511cc6c5c5
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user