diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-16 20:55:34 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-16 20:57:08 -0700 |
commit | 121f3a92ea86258ab8507c6a7759cd2242bebab6 (patch) | |
tree | 0f3e87b3b1a1feb5f1f0cab6da50e53fb929b7a1 /src | |
parent | d918144f16111358a61d6f5f847227946bcc17a9 (diff) | |
download | scala-121f3a92ea86258ab8507c6a7759cd2242bebab6.tar.gz scala-121f3a92ea86258ab8507c6a7759cd2242bebab6.tar.bz2 scala-121f3a92ea86258ab8507c6a7759cd2242bebab6.zip |
Revert "Added constant empty array to the companion objects."
This reverts most of commit 9d84e89d2 .
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/cmd/gen/AnyVals.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Boolean.scala | 7 | ||||
-rw-r--r-- | src/library/scala/Byte.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Char.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Double.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Float.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Int.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Long.scala | 8 | ||||
-rw-r--r-- | src/library/scala/Short.scala | 8 |
9 files changed, 1 insertions, 70 deletions
diff --git a/src/compiler/scala/tools/cmd/gen/AnyVals.scala b/src/compiler/scala/tools/cmd/gen/AnyVals.scala index b4f5641b98..6d652ffdfe 100644 --- a/src/compiler/scala/tools/cmd/gen/AnyVals.scala +++ b/src/compiler/scala/tools/cmd/gen/AnyVals.scala @@ -320,13 +320,7 @@ def unbox(x: java.lang.Object): @name@ = @unboxImpl@ override def toString = "object scala.@name@" """ - def nonUnitCompanions = """ -/** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[@name@] - */ -final val emptyArray = new Array[@name@](0)""" + def nonUnitCompanions = "" // todo def cardinalCompanion = """ /** The smallest value representable as a @name@. diff --git a/src/library/scala/Boolean.scala b/src/library/scala/Boolean.scala index d7311078ab..440e546f19 100644 --- a/src/library/scala/Boolean.scala +++ b/src/library/scala/Boolean.scala @@ -135,12 +135,5 @@ object Boolean extends AnyValCompanion { */ override def toString = "object scala.Boolean" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Boolean] - */ - final val emptyArray = new Array[Boolean](0) } diff --git a/src/library/scala/Byte.scala b/src/library/scala/Byte.scala index 02ef913fc5..df0d2c73b1 100644 --- a/src/library/scala/Byte.scala +++ b/src/library/scala/Byte.scala @@ -625,14 +625,6 @@ object Byte extends AnyValCompanion { */ override def toString = "object scala.Byte" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Byte] - */ - final val emptyArray = new Array[Byte](0) - /** Language mandated coercions from Byte to "wider" types. */ implicit def byte2short(x: Byte): Short = x.toShort diff --git a/src/library/scala/Char.scala b/src/library/scala/Char.scala index 5a1bf16f1d..1fa0c0d9e8 100644 --- a/src/library/scala/Char.scala +++ b/src/library/scala/Char.scala @@ -625,14 +625,6 @@ object Char extends AnyValCompanion { */ override def toString = "object scala.Char" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Char] - */ - final val emptyArray = new Array[Char](0) - /** Language mandated coercions from Char to "wider" types. */ implicit def char2int(x: Char): Int = x.toInt diff --git a/src/library/scala/Double.scala b/src/library/scala/Double.scala index 7bebbf9418..f058d7c26b 100644 --- a/src/library/scala/Double.scala +++ b/src/library/scala/Double.scala @@ -400,13 +400,5 @@ object Double extends AnyValCompanion { /** The String representation of the scala.Double companion object. */ override def toString = "object scala.Double" - - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Double] - */ - final val emptyArray = new Array[Double](0) } diff --git a/src/library/scala/Float.scala b/src/library/scala/Float.scala index 79ed2ac20b..d942acec23 100644 --- a/src/library/scala/Float.scala +++ b/src/library/scala/Float.scala @@ -401,14 +401,6 @@ object Float extends AnyValCompanion { */ override def toString = "object scala.Float" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Float] - */ - final val emptyArray = new Array[Float](0) - /** Language mandated coercions from Float to "wider" types. */ implicit def float2double(x: Float): Double = x.toDouble diff --git a/src/library/scala/Int.scala b/src/library/scala/Int.scala index fa2f9a97e7..ae36413469 100644 --- a/src/library/scala/Int.scala +++ b/src/library/scala/Int.scala @@ -625,14 +625,6 @@ object Int extends AnyValCompanion { */ override def toString = "object scala.Int" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Int] - */ - final val emptyArray = new Array[Int](0) - /** Language mandated coercions from Int to "wider" types. */ implicit def int2long(x: Int): Long = x.toLong diff --git a/src/library/scala/Long.scala b/src/library/scala/Long.scala index 94204e893c..4ee9383c2a 100644 --- a/src/library/scala/Long.scala +++ b/src/library/scala/Long.scala @@ -625,14 +625,6 @@ object Long extends AnyValCompanion { */ override def toString = "object scala.Long" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Long] - */ - final val emptyArray = new Array[Long](0) - /** Language mandated coercions from Long to "wider" types. */ implicit def long2float(x: Long): Float = x.toFloat diff --git a/src/library/scala/Short.scala b/src/library/scala/Short.scala index aef8608d2e..35c5fe3ff0 100644 --- a/src/library/scala/Short.scala +++ b/src/library/scala/Short.scala @@ -625,14 +625,6 @@ object Short extends AnyValCompanion { */ override def toString = "object scala.Short" - - /** A highly reusable empty array, useful for avoiding - * allocations when you need one. - * - * @return a constant 0-length Array[Short] - */ - final val emptyArray = new Array[Short](0) - /** Language mandated coercions from Short to "wider" types. */ implicit def short2int(x: Short): Int = x.toInt |