diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2010-08-16 17:35:07 +0000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2010-08-16 17:35:07 +0000 |
commit | 3ca4c6ef6ccbd7cbc9dd1dd3eaffa5b8ef164fb9 (patch) | |
tree | b4f6153e8ba8ee6f83f2b5f92ed5b7dc7a075f27 | |
parent | daaede456dd2e5f0d7afaa76855765ae3e647bd5 (diff) | |
download | scala-3ca4c6ef6ccbd7cbc9dd1dd3eaffa5b8ef164fb9.tar.gz scala-3ca4c6ef6ccbd7cbc9dd1dd3eaffa5b8ef164fb9.tar.bz2 scala-3ca4c6ef6ccbd7cbc9dd1dd3eaffa5b8ef164fb9.zip |
use arraycopy instead of Array.copy in ArrayBuf...
use arraycopy instead of Array.copy in ArrayBuffer's sizeHint. close
#3766, review by extempore.
-rw-r--r-- | src/library/scala/collection/mutable/ArrayBuffer.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/ArrayBuffer.scala b/src/library/scala/collection/mutable/ArrayBuffer.scala index 46e9e80481..216d7d0d38 100644 --- a/src/library/scala/collection/mutable/ArrayBuffer.scala +++ b/src/library/scala/collection/mutable/ArrayBuffer.scala @@ -61,7 +61,8 @@ class ArrayBuffer[A](override protected val initialSize: Int) override def sizeHint(len: Int) { if (len > size && len >= 1) { val newarray = new Array[AnyRef](len) - Array.copy(array, 0, newarray, 0, size0) + // use arraycopy, not Array.copy, see #3766 + Platform.arraycopy(array, 0, newarray, 0, size0) array = newarray } } |