From: Feross Aboukhadijeh Date: Thu, 8 May 2014 00:04:23 +0000 (-0700) Subject: Remove Buffer._charsWritten (parity with 0.11) X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=4fa21ee16e2019aa29aa55283784303f7013f547;p=buffer.git Remove Buffer._charsWritten (parity with 0.11) --- diff --git a/index.js b/index.js index 7a84e85..e45ebcf 100644 --- 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 }