Skip to content

Commit

Permalink
buffer: remove unreachable code
Browse files Browse the repository at this point in the history
Remove unreachable code from lib/buffer.js.

PR-URL: #27445
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and targos committed Apr 30, 2019
1 parent 3711684 commit 53eefeb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,11 +894,7 @@ Buffer.prototype.write = function write(string, offset, length, encoding) {

// Buffer#write(string, offset[, length][, encoding])
} else {
if (offset === undefined) {
offset = 0;
} else {
validateInt32(offset, 'offset', 0, this.length);
}
validateInt32(offset, 'offset', 0, this.length);

const remaining = this.length - offset;

Expand Down

0 comments on commit 53eefeb

Please sign in to comment.