aboutsummaryrefslogtreecommitdiffhomepage
path: root/java/src/main/java/com/google/protobuf/DoubleArrayList.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/main/java/com/google/protobuf/DoubleArrayList.java')
-rw-r--r--java/src/main/java/com/google/protobuf/DoubleArrayList.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/java/src/main/java/com/google/protobuf/DoubleArrayList.java b/java/src/main/java/com/google/protobuf/DoubleArrayList.java
index 90ebe109..bcc9d6ee 100644
--- a/java/src/main/java/com/google/protobuf/DoubleArrayList.java
+++ b/java/src/main/java/com/google/protobuf/DoubleArrayList.java
@@ -68,10 +68,17 @@ final class DoubleArrayList
private int size;
/**
- * Constructs a new mutable {@code DoubleArrayList}.
+ * Constructs a new mutable {@code DoubleArrayList} with default capacity.
*/
DoubleArrayList() {
- array = new double[DEFAULT_CAPACITY];
+ this(DEFAULT_CAPACITY);
+ }
+
+ /**
+ * Constructs a new mutable {@code DoubleArrayList} with the provided capacity.
+ */
+ DoubleArrayList(int capacity) {
+ array = new double[capacity];
size = 0;
}