We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bb5e7e commit 72e58f5Copy full SHA for 72e58f5
lib/storage/src/chunks/getChunkStream.ts
@@ -19,15 +19,11 @@ export async function* getChunkStream<T>(
19
currentBuffer.length += datum.length;
20
21
while (currentBuffer.length >= partSize) {
22
- let dataChunk: Buffer = currentBuffer.chunks[0];
23
-
24
/**
25
* Concat all the buffers together once if there is more than one to concat. Attempt
26
* to minimize concats as Buffer.Concat is an extremely expensive operation.
27
*/
28
- if (currentBuffer.chunks.length > 1) {
29
- dataChunk = Buffer.concat(currentBuffer.chunks);
30
- }
+ const dataChunk = currentBuffer.chunks.length > 1 ? Buffer.concat(currentBuffer.chunks) : currentBuffer.chunks[0];
31
32
yield {
33
partNumber,
0 commit comments