aboutsummaryrefslogtreecommitdiff
path: root/guava/src/com/google/common/primitives/ImmutableDoubleArray.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava/src/com/google/common/primitives/ImmutableDoubleArray.java')
-rw-r--r--guava/src/com/google/common/primitives/ImmutableDoubleArray.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/guava/src/com/google/common/primitives/ImmutableDoubleArray.java b/guava/src/com/google/common/primitives/ImmutableDoubleArray.java
index f2111cb1b..9d0f05c8b 100644
--- a/guava/src/com/google/common/primitives/ImmutableDoubleArray.java
+++ b/guava/src/com/google/common/primitives/ImmutableDoubleArray.java
@@ -294,9 +294,7 @@ public final class ImmutableDoubleArray implements Serializable {
private void ensureRoomFor(int numberToAdd) {
int newCount = count + numberToAdd; // TODO(kevinb): check overflow now?
if (newCount > array.length) {
- double[] newArray = new double[expandedCapacity(array.length, newCount)];
- System.arraycopy(array, 0, newArray, 0, count);
- this.array = newArray;
+ array = Arrays.copyOf(array, expandedCapacity(array.length, newCount));
}
}