Stop using, opt match { case Some(x) => f(x); case None => y } Stop using, http://opt.map (f).getOrElse(y) Use, opt.fold(y)(f) I feel like I'm very late to this party.
I had my doubts. In complexity terms, a pattern match should be linear whereas a virtual method dispatch should be constant time, right? Unless its marked @switch, I presume.
-
-
> right? who knows with the JIT and different JVM versions and different JVMs. I just went with measuring it. and then looking for review comments from anyone.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.