From 4fa21ee16e2019aa29aa55283784303f7013f547 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 7 May 2014 17:04:23 -0700 Subject: [PATCH] Remove Buffer._charsWritten (parity with 0.11) --- index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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 } -- 2.34.1