Skip to content

Commit 174ebf7

Browse files
committed
Allocate more space when creating newShape list to avoid resizing.
1 parent 4f9cb95 commit 174ebf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

com.ibm.wala.cast.python.ml/source/com/ibm/wala/cast/python/ml/client/RaggedConstant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ protected Set<List<Dimension<?>>> getShapesOfValue(
369369

370370
// Determine the uniform lengths for dimensions R + 1 to K - 1.
371371
for (int innerListLength : possibleInnerListLengths) {
372-
List<Dimension<?>> newShape = new ArrayList<>();
372+
List<Dimension<?>> newShape = new ArrayList<>(shape.size());
373373
newShape.addAll(shape);
374374

375375
for (long i = R + 1; i < K; i++) newShape.add(new NumericDim(innerListLength));

0 commit comments

Comments
 (0)