Skip to content

Commit

Permalink
net: remove redundant code from _writeGeneric()
Browse files Browse the repository at this point in the history
The encoding is already handled by `Writable.prototype.write()`.

PR-URL: #18429
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
lpinca authored and MylesBorins committed Mar 30, 2018
1 parent cc7469e commit 269c2f3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,13 +710,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
// Retain chunks
if (err === 0) req._chunks = chunks;
} else {
var enc;
if (data instanceof Buffer) {
enc = 'buffer';
} else {
enc = encoding;
}
err = createWriteReq(req, this._handle, data, enc);
err = createWriteReq(req, this._handle, data, encoding);
}

if (err)
Expand Down

0 comments on commit 269c2f3

Please sign in to comment.