Skip to content

Commit 72e58f5

Browse files
committed
fix: nit single line branch
1 parent 6bb5e7e commit 72e58f5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/storage/src/chunks/getChunkStream.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@ export async function* getChunkStream<T>(
1919
currentBuffer.length += datum.length;
2020

2121
while (currentBuffer.length >= partSize) {
22-
let dataChunk: Buffer = currentBuffer.chunks[0];
23-
2422
/**
2523
* Concat all the buffers together once if there is more than one to concat. Attempt
2624
* to minimize concats as Buffer.Concat is an extremely expensive operation.
2725
*/
28-
if (currentBuffer.chunks.length > 1) {
29-
dataChunk = Buffer.concat(currentBuffer.chunks);
30-
}
26+
const dataChunk = currentBuffer.chunks.length > 1 ? Buffer.concat(currentBuffer.chunks) : currentBuffer.chunks[0];
3127

3228
yield {
3329
partNumber,

0 commit comments

Comments
 (0)