Skip to content

Commit cee1c39

Browse files
committed
Simplify code
1 parent 9157c64 commit cee1c39

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/io/CompressedOutputStream.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,9 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os,
126126
// Allocate first buffer and add padding for incompressible blocks
127127
const int bufSize = max(_blockSize + (_blockSize >> 3), DEFAULT_BUFFER_SIZE);
128128
_buffers[0] = new SliceArray<byte>(new byte[bufSize], bufSize, 0);
129-
_buffers[_jobs] = new SliceArray<byte>(nullptr, 0, 0);
130129

131-
for (int i = 1; i < _jobs; i++) {
130+
for (int i = 1; i < 2 * _jobs; i++)
132131
_buffers[i] = new SliceArray<byte>(nullptr, 0, 0);
133-
_buffers[i + _jobs] = new SliceArray<byte>(nullptr, 0, 0);
134-
}
135132
}
136133

137134
CompressedOutputStream::CompressedOutputStream(OutputStream& os, Context& ctx, bool headerless)
@@ -210,12 +207,9 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os, Context& ctx, b
210207
// Allocate first buffer and add padding for incompressible blocks
211208
const int bufSize = max(_blockSize + (_blockSize >> 3), DEFAULT_BUFFER_SIZE);
212209
_buffers[0] = new SliceArray<byte>(new byte[bufSize], bufSize, 0);
213-
_buffers[_jobs] = new SliceArray<byte>(nullptr, 0, 0);
214210

215-
for (int i = 1; i < _jobs; i++) {
211+
for (int i = 1; i < 2 * _jobs; i++)
216212
_buffers[i] = new SliceArray<byte>(nullptr, 0, 0);
217-
_buffers[i + _jobs] = new SliceArray<byte>(nullptr, 0, 0);
218-
}
219213
}
220214

221215
CompressedOutputStream::~CompressedOutputStream()

0 commit comments

Comments
 (0)