From db002da308af8a72e36a494f277df1a319d5cf14 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 17 Nov 2021 09:27:41 +0100 Subject: [PATCH] fixup: hwm --- lib/internal/streams/operators.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/internal/streams/operators.js b/lib/internal/streams/operators.js index 9fee6024e3173a..00156164883d58 100644 --- a/lib/internal/streams/operators.js +++ b/lib/internal/streams/operators.js @@ -15,12 +15,6 @@ module.exports.map = function map(stream, fn, options) { concurrency = options.concurrency; } - let highWaterMark = 1; - if (options && Number.isFinite(options.highWaterMark)) { - highWaterMark = options.highWaterMark; - } - highWaterMark = Math.max(0, highWaterMark - concurrency) - let objectMode = stream.readableObjectMode ?? stream.objectMode ?? true; if (options && typeof options.objectMode === 'boolean') { objectMode = options.objectMode; @@ -32,9 +26,9 @@ module.exports.map = function map(stream, fn, options) { let reading = false; + // TODO: What about hwm? This will cause some unecessary buffering. const ret = new Readable({ objectMode, - highWaterMark, read () { if (!reading) { read();