Fixing bug in ifOffYield

This commit is contained in:
Viktor Klang 2011-02-23 13:26:27 +01:00
parent 169d97ee5f
commit ba8c187b5c

View file

@ -144,7 +144,7 @@ class Switch(startAsOn: Boolean = false) {
}
def ifOffYield[T](action: => T): Option[T] = {
if (switch.get) Some(action)
if (!switch.get) Some(action)
else None
}