diff options
author | Paul Phillips <paulp@improving.org> | 2009-11-20 00:49:58 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-11-20 00:49:58 +0000 |
commit | 7356f7782a169a3e9a14b3ef5f4a948948c7c2ff (patch) | |
tree | c67e05d18d2f174352a9365d238bc8c153768b37 /src | |
parent | 04a99160c27257565438b58e814c885283521358 (diff) | |
download | scala-7356f7782a169a3e9a14b3ef5f4a948948c7c2ff.tar.gz scala-7356f7782a169a3e9a14b3ef5f4a948948c7c2ff.tar.bz2 scala-7356f7782a169a3e9a14b3ef5f4a948948c7c2ff.zip |
Fix for infinite loop in StringBuilder pointed ...
Fix for infinite loop in StringBuilder pointed out by dpp.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/mutable/StringBuilder.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala index 47bac8ad47..9018f0be76 100644 --- a/src/library/scala/collection/mutable/StringBuilder.scala +++ b/src/library/scala/collection/mutable/StringBuilder.scala @@ -114,7 +114,7 @@ final class StringBuilder(initCapacity: Int, private val initValue: String) * @param n the minimum desired capacity. */ def ensureCapacity(n: Int) { - if (n > array.length) { + if (n > array.length && array.length > 0) { var newsize = array.length * 2 while (n > newsize) newsize = newsize * 2 |