summaryrefslogtreecommitdiff
path: root/lib/buffer.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/buffer.js')
-rw-r--r--lib/buffer.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/buffer.js b/lib/buffer.js
index 1fac94d568..8c16f07ace 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -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;