Skip to content

Commit

Permalink
fixup: hwm
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 17, 2021
1 parent ed7c896 commit db002da
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/internal/streams/operators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit db002da

Please sign in to comment.