diff options
author | Paul Phillips <paulp@improving.org> | 2010-01-16 03:54:39 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-01-16 03:54:39 +0000 |
commit | 36ef60e68c03bc1c7fd2e910ae7d70d4ec32d3bf (patch) | |
tree | d663145af9c6e9f02bed79fbcd83549234c8727c /src/library/scala/collection/mutable/WrappedArray.scala | |
parent | 74c615c83567c930ce371833ff4b275312a4540f (diff) | |
download | scala-36ef60e68c03bc1c7fd2e910ae7d70d4ec32d3bf.tar.gz scala-36ef60e68c03bc1c7fd2e910ae7d70d4ec32d3bf.tar.bz2 scala-36ef60e68c03bc1c7fd2e910ae7d70d4ec32d3bf.zip |
Exposed native Array clone() method.
Review by dragos.
Diffstat (limited to 'src/library/scala/collection/mutable/WrappedArray.scala')
-rw-r--r-- | src/library/scala/collection/mutable/WrappedArray.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/WrappedArray.scala b/src/library/scala/collection/mutable/WrappedArray.scala index cedeb673e0..6652f5e40a 100644 --- a/src/library/scala/collection/mutable/WrappedArray.scala +++ b/src/library/scala/collection/mutable/WrappedArray.scala @@ -43,6 +43,9 @@ abstract class WrappedArray[T] extends IndexedSeq[T] with ArrayLike[T, WrappedAr def array: Array[T] override def stringPrefix = "WrappedArray" + /** Clones this object, including the underlying Array. */ + override def clone: WrappedArray[T] = WrappedArray make array.clone() + /** Creates new builder for this collection ==> move to subclasses */ override protected[this] def newBuilder: Builder[T, WrappedArray[T]] = @@ -50,7 +53,6 @@ abstract class WrappedArray[T] extends IndexedSeq[T] with ArrayLike[T, WrappedAr } object WrappedArray { - def make[T](x: AnyRef): WrappedArray[T] = x match { case x: Array[AnyRef] => wrapRefArray[AnyRef](x).asInstanceOf[WrappedArray[T]] case x: Array[Int] => wrapIntArray(x).asInstanceOf[WrappedArray[T]] |