Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
net: remove redundant code from _writeGeneric()
The encoding is already handled by `Writable.prototype.write()`.
  • Loading branch information
lpinca committed Jan 29, 2018
commit 09ccdff13c7388449c8f3819fed6d54fffa5701f
8 changes: 1 addition & 7 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,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