From: Fedor Nezhivoi Date: Sat, 20 Jun 2020 01:25:32 +0000 (+1000) Subject: remove redundant latin1Write function X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=419d07ff2b730383754af86d5c775de997f445e4;p=buffer.git remove redundant latin1Write function --- diff --git a/index.js b/index.js index e87bfaa..80a9d1d 100644 --- a/index.js +++ b/index.js @@ -841,10 +841,6 @@ function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } @@ -900,11 +896,9 @@ Buffer.prototype.write = function write (string, offset, length, encoding) { return utf8Write(this, string, offset, length) case 'ascii': - return asciiWrite(this, string, offset, length) - case 'latin1': case 'binary': - return latin1Write(this, string, offset, length) + return asciiWrite(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write