From 105d5607a86477b2d4702594d5b1b62c3118d62e Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Fri, 26 Jun 2020 16:54:44 +0300 Subject: [PATCH] zlib: remove redundant variable in zlibBufferOnEnd PR-URL: https://github.com/nodejs/node/pull/34072 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau --- lib/zlib.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/zlib.js b/lib/zlib.js index 8ee2c143e5ae6f..7cc8e2e6275041 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -138,7 +138,6 @@ function zlibBufferOnError(err) { function zlibBufferOnEnd() { let buf; - let err; if (this.nread === 0) { buf = Buffer.alloc(0); } else { @@ -146,9 +145,7 @@ function zlibBufferOnEnd() { buf = (bufs.length === 1 ? bufs[0] : Buffer.concat(bufs, this.nread)); } this.close(); - if (err) - this.cb(err); - else if (this._info) + if (this._info) this.cb(null, { buffer: buf, engine: this }); else this.cb(null, buf);