Skip to content

Commit 196704d

Browse files
committed
Tweaks.
1 parent 555d468 commit 196704d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/com/dannemann/stringcompressor/bulk/ManagedBulkCompressorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void batchCompressByteArrayTest() {
4343
final int batchSize = RANDOM.nextInt(500, 1000);
4444
final int numberOfBatches = RANDOM.nextInt(500, 1000);
4545
final int totalElements = batchSize * numberOfBatches;
46-
final List<byte[]> fullSource = new ArrayList<>();
46+
final List<byte[]> fullSource = new ArrayList<>(totalElements);
4747
final byte[][] destination = new byte[totalElements * 2][]; // Half empty.
4848
final FourBitAsciiCompressor compressor = new FourBitAsciiCompressor(true, true);
4949
final ManagedBulkCompressor managed = new ManagedBulkCompressor(compressor, destination);
@@ -82,7 +82,7 @@ void batchCompressStringArrayTest() {
8282
final int batchSize = RANDOM.nextInt(500, 1000);
8383
final int numberOfBatches = RANDOM.nextInt(500, 1000);
8484
final int totalElements = batchSize * numberOfBatches;
85-
final List<String> fullSource = new ArrayList<>();
85+
final List<String> fullSource = new ArrayList<>(totalElements);
8686
final byte[][] destination = new byte[totalElements * 2][]; // Half empty.
8787
final FiveBitAsciiCompressor compressor = new FiveBitAsciiCompressor(true, true);
8888
final ManagedBulkCompressor managed = new ManagedBulkCompressor(compressor, destination);
@@ -121,7 +121,7 @@ void batchCompressStringListTest() {
121121
final int batchSize = RANDOM.nextInt(500, 1000);
122122
final int numberOfBatches = RANDOM.nextInt(500, 1000);
123123
final int totalElements = batchSize * numberOfBatches;
124-
final List<String> fullSource = new ArrayList<>();
124+
final List<String> fullSource = new ArrayList<>(totalElements);
125125
final byte[][] destination = new byte[totalElements * 2][]; // Half empty.
126126
final SixBitAsciiCompressor compressor = new SixBitAsciiCompressor(true, true);
127127
final ManagedBulkCompressor managed = new ManagedBulkCompressor(compressor, destination);

0 commit comments

Comments
 (0)