From 0702152f2ec63819ac1a3fd668e2de13c9b9839e Mon Sep 17 00:00:00 2001 From: Jesus Hernandez Date: Sun, 19 Apr 2020 21:01:39 -0500 Subject: [PATCH] stream: removes unnecessary params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes the state param in the onFinished function since it's never used within it. PR-URL: https://github.com/nodejs/node/pull/32936 Reviewed-By: Luigi Pinca Reviewed-By: Gerhard Stöbich --- lib/_stream_writable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 57b1b9cc92fb32..7c40929d73c180 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -582,7 +582,7 @@ Writable.prototype.end = function(chunk, encoding, cb) { if (err || state.finished) process.nextTick(cb, err); else - onFinished(this, state, cb); + onFinished(this, cb); } return this; @@ -664,7 +664,7 @@ function finish(stream, state) { } // TODO(ronag): Avoid using events to implement internal logic. -function onFinished(stream, state, cb) { +function onFinished(stream, cb) { function onerror(err) { stream.removeListener('finish', onfinish); stream.removeListener('error', onerror);