From 3bce627d65e61f2ed2454da3c26e946846cb57d2 Mon Sep 17 00:00:00 2001 From: Jesse Tane Date: Fri, 13 Feb 2015 16:39:23 -0500 Subject: [PATCH] remove redundant code unit size check --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a2c9324..a526681 100644 --- a/index.js +++ b/index.js @@ -371,7 +371,7 @@ function base64Write (buf, string, offset, length) { } function utf16leWrite (buf, string, offset, length) { - var charsWritten = blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length, 2) + var charsWritten = blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) return charsWritten } @@ -1292,8 +1292,7 @@ function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } -function blitBuffer (src, dst, offset, length, unitSize) { - if (unitSize) length -= length % unitSize +function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; i++) { if ((i + offset >= dst.length) || (i >= src.length)) break -- 2.34.1