Skip to content

Instantly share code, notes, and snippets.

@milessabin
Created January 31, 2014 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milessabin/8743568 to your computer and use it in GitHub Desktop.
Save milessabin/8743568 to your computer and use it in GitHub Desktop.
Is breakOut just an optimization?
scala> import scala.collection._
import scala.collection._
scala> val l1: List[Int] = Set(1, 2, 3, 4).map(_/2).toList
l1: List[Int] = List(0, 1, 2)
scala> val l1: List[Int] = Set(1, 2, 3, 4).map(_/2)(breakOut)
l1: List[Int] = List(0, 1, 1, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment