]> zoso.dev Git - buffer.git/commitdiff
remove redundant latin1Write function
authorFedor Nezhivoi <gyzerok@users.noreply.github.com>
Sat, 20 Jun 2020 01:25:32 +0000 (11:25 +1000)
committerFedor Nezhivoi <gyzerok@users.noreply.github.com>
Sat, 20 Jun 2020 01:25:32 +0000 (11:25 +1000)
index.js

index e87bfaaa76ec628aebfeadf7cca0935cefa74257..80a9d1da9b8535a6803feeac54c0b40d4a41644b 100644 (file)
--- 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