This SO answer describes how scala.collection.breakOut can be used to prevent creating wasteful intermediate collections. For example, here we create an intermediate Seq[(String,String)]: val m = List("A", "B", "C").map(x => x -> x).toMap By using breakOut we can prevent the creation of this intermediate Seq: val m: Map[String,String] = List("A", "B", "C").map(x => x -> x)(breakOut) Views solve th
