diff options
author | mihaylov <mihaylov@epfl.ch> | 2006-03-28 07:45:38 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2006-03-28 07:45:38 +0000 |
commit | f64d8a594c512c16763a33e72c3f9eae2671192f (patch) | |
tree | cd0c684dd585509f7d23e1696f860b377aa2b982 /src/library | |
parent | 6b46664e637ff526507bd31b5bd2fb3cea1e715e (diff) | |
download | scala-f64d8a594c512c16763a33e72c3f9eae2671192f.tar.gz scala-f64d8a594c512c16763a33e72c3f9eae2671192f.tar.bz2 scala-f64d8a594c512c16763a33e72c3f9eae2671192f.zip |
Added BoxedArray.toArray method to override Seq...
Added BoxedArray.toArray method to override Seq.toArray for efficiency
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/runtime/BoxedArray.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library/scala/runtime/BoxedArray.scala b/src/library/scala/runtime/BoxedArray.scala index c631c0292e..4550be053d 100644 --- a/src/library/scala/runtime/BoxedArray.scala +++ b/src/library/scala/runtime/BoxedArray.scala @@ -46,6 +46,13 @@ abstract class BoxedArray extends PartialFunction[Int, Object] with Seq[Object] Array.copy(value, from, dest, to, len) } + override def toArray[b>:Object]: Array[b] = { + val len = length + val res = new Array[b](len) + copyTo(0, res, 0, len) + res + } + def subArray(from: Int, end: Int): Object def filter(p: Any => Boolean): Object |