=> B): Arr1 = { var i = 0 while(i < a.length) { val v1 = a(i).asInstanceOf[AnyRef] val v2 = f(v1.asInstanceOf[A]).asInstanceOf[AnyRef] if(v1 ne v2) return mapElems1Rest(a, f, i, v2) i += 1 } a } 18
List scala/collection/immutable/List.scala#L245-L259 final override def map[B](f: A => B): List[B] = { if (this eq Nil) Nil else { val h = new ::[B](f(head), Nil) var t: ::[B] = h var rest = tail while (rest ne Nil) { val nx = new ::(f(rest.head), Nil) t.next = nx t = nx rest = rest.tail } releaseFence() h } } 20
Set[E] = it match { case _: SortedSet[E] => (newBuilder[E] ++= it).result() case _ if it.knownSize == 0 => empty[E] case s: Set[E] => s case _ => (newBuilder[E] ++= it).result() } 24