]> zoso.dev Git - buffer.git/commitdiff
Remove Buffer._charsWritten (parity with 0.11)
authorFeross Aboukhadijeh <feross@feross.org>
Thu, 8 May 2014 00:04:23 +0000 (17:04 -0700)
committerFeross Aboukhadijeh <feross@feross.org>
Thu, 8 May 2014 00:04:23 +0000 (17:04 -0700)
index.js

index 7a84e85366932d1a3bc68be616e3789ca350d608..e45ebcfe52ca0c4fb6a344f4ccfeb12e7e3deb96 100644 (file)
--- a/index.js
+++ b/index.js
@@ -236,19 +236,16 @@ function hexWrite (buf, string, offset, length) {
     assert(!isNaN(byte), 'Invalid hex string')
     buf[offset + i] = byte
   }
-  Buffer._charsWritten = i * 2
   return i
 }
 
 function utf8Write (buf, string, offset, length) {
-  var charsWritten = Buffer._charsWritten =
-    blitBuffer(utf8ToBytes(string), buf, offset, length)
+  var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
   return charsWritten
 }
 
 function asciiWrite (buf, string, offset, length) {
-  var charsWritten = Buffer._charsWritten =
-    blitBuffer(asciiToBytes(string), buf, offset, length)
+  var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length)
   return charsWritten
 }
 
@@ -257,14 +254,12 @@ function binaryWrite (buf, string, offset, length) {
 }
 
 function base64Write (buf, string, offset, length) {
-  var charsWritten = Buffer._charsWritten =
-    blitBuffer(base64ToBytes(string), buf, offset, length)
+  var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length)
   return charsWritten
 }
 
 function utf16leWrite (buf, string, offset, length) {
-  var charsWritten = Buffer._charsWritten =
-    blitBuffer(utf16leToBytes(string), buf, offset, length)
+  var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length)
   return charsWritten
 }