Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[nomaster] Revert "SI-5017 Poor performance of :+ operator on Arrays"

This reverts commit 02b2da6.
  • Loading branch information...
commit 015ff514e18bdcd016f7175202286ac4c0d42831 1 parent b99af13
@JamesIry JamesIry authored
View
14 src/library/scala/collection/mutable/ArrayOps.scala
@@ -52,20 +52,6 @@ trait ArrayOps[T] extends Any with ArrayLike[T, Array[T]] with CustomParalleliza
super.toArray[U]
}
- def :+[B >: T: scala.reflect.ClassTag](elem: B): Array[B] = {
- val result = Array.ofDim[B](repr.length + 1)
- Array.copy(repr, 0, result, 0, repr.length)
- result(repr.length) = elem
- result
- }
-
- def +:[B >: T: scala.reflect.ClassTag](elem: B): Array[B] = {
- val result = Array.ofDim[B](repr.length + 1)
- result(0) = elem
- Array.copy(repr, 0, result, 1, repr.length)
- result
- }
-
override def par = ParArray.handoff(repr)
/** Flattens a two-dimensional array by concatenating all its rows
View
4 test/files/run/array-addition.check
@@ -1,4 +0,0 @@
-Array(1, 2, 3, 4)
-Array(1, 2, 3, 4)
-Array(1)
-Array(1)
View
11 test/files/run/array-addition.scala
@@ -1,11 +0,0 @@
-object Test {
- def prettyPrintArray(x: Array[_]) = println("Array(" + x.mkString(", ") + ")")
-
- def main(args: Array[String]): Unit = {
- prettyPrintArray(Array(1,2,3) :+ 4)
- prettyPrintArray(1 +: Array(2,3,4))
- prettyPrintArray(Array() :+ 1)
- prettyPrintArray(1 +: Array())
- }
-}
-

2 comments on commit 015ff51

@scala-jenkins

Job pr-rangepos-per-commit failed for 015ff51 (results):


Took 8 s.
sad kitty
to rebuild, comment "PLS REBUILD/pr-rangepos-per-commit@015ff51"on PR #2112

@scala-jenkins

Job pr-checkin-per-commit failed for 015ff51 (results):


Took 11 s.
sad kitty
to rebuild, comment "PLS REBUILD/pr-checkin-per-commit@015ff51"on PR #2112

Please sign in to comment.
Something went wrong with that request. Please try again.