From d5a0940fff9091dc6e5c4e3aaed35e07d69b52c8 Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 5 Mar 2013 22:16:46 -0800 Subject: [PATCH] stream: Remove pipeOpts.chunkSize It's not actually necessary for backwards compatibility, isn't used anywhere, and isn't even tested. Better to just remove it. --- lib/_stream_readable.js | 7 +------ test/simple/test-stream2-fs.js | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 1131b24a2e..95d4d0effb 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -75,7 +75,6 @@ function ReadableState(options, stream) { // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; - this.pipeChunkSize = null; this.decoder = null; if (options.encoding) { @@ -420,9 +419,6 @@ Readable.prototype.pipe = function(dest, pipeOpts) { cleanup(); } - if (pipeOpts && pipeOpts.chunkSize) - state.pipeChunkSize = pipeOpts.chunkSize; - function onend() { dest.end(); } @@ -520,8 +516,7 @@ function flow(src) { } } - while (state.pipesCount && - null !== (chunk = src.read(state.pipeChunkSize))) { + while (state.pipesCount && null !== (chunk = src.read())) { if (state.pipesCount === 1) write(state.pipes, 0, null); diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js index 70cd8ba4de..09f77b9a66 100644 --- a/test/simple/test-stream2-fs.js +++ b/test/simple/test-stream2-fs.js @@ -73,4 +73,4 @@ w.on('results', function(res) { console.log('ok'); }); -r.pipe(w, { chunkSize: 10 }); +r.pipe(w);