summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/collection/mutable/ArrayBuilder.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/library/scala/collection/mutable/ArrayBuilder.scala b/src/library/scala/collection/mutable/ArrayBuilder.scala
index cab7a4bd7f..ec1351f671 100644
--- a/src/library/scala/collection/mutable/ArrayBuilder.scala
+++ b/src/library/scala/collection/mutable/ArrayBuilder.scala
@@ -63,7 +63,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -127,7 +127,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -191,7 +191,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -255,7 +255,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -319,7 +319,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -383,7 +383,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -447,7 +447,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -511,7 +511,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -575,7 +575,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)
@@ -639,7 +639,7 @@ object ArrayBuilder {
}
private def ensureSize(size: Int) {
- if (capacity < size) {
+ if (capacity < size || capacity == 0) {
var newsize = if (capacity == 0) 16 else capacity * 2
while (newsize < size) newsize *= 2
resize(newsize)