★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/958f5eda9aNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
net: remove redundant code from _writeGeneric()
The encoding is already handled by `Writable.prototype.write()`.

PR-URL: #18429
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
lpinca authored and MylesBorins committed Feb 21, 2018
1 parent ae8f5db commit 958f5eda9a9f38c2007fc167a2bf7bd0a0a59627
Showing with 1 addition and 7 deletions.
  1. +1 −7 lib/net.js
@@ -758,13 +758,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)

0 comments on commit 958f5ed

Please sign in to comment.