Skip to content

Commit

Permalink
zlib: remove redundant variable in zlibBufferOnEnd
Browse files Browse the repository at this point in the history
PR-URL: #34072
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
puzpuzpuz authored and MylesBorins committed Jul 16, 2020
1 parent 4927fed commit 105d560
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,14 @@ function zlibBufferOnError(err) {

function zlibBufferOnEnd() {
let buf;
let err;
if (this.nread === 0) {
buf = Buffer.alloc(0);
} else {
const bufs = this.buffers;
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);
Expand Down

0 comments on commit 105d560

Please sign in to comment.