From 3d622d3c0bf330e332d6656db7aa3880adb52566 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sun, 16 Aug 2015 01:55:27 +1000 Subject: [PATCH] avoid duplicate function --- index.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/index.js b/index.js index b628935..8d0a531 100644 --- a/index.js +++ b/index.js @@ -622,17 +622,6 @@ function base64Slice (buf, start, end) { } } -function decodeLargeCodePointsArray (array) { - var res = '' - var end = array.length - - for (var i = 0; i < end; i++) { - res += String.fromCharCode(array[i]) - } - - return res -} - function decodeCodePointsArray (array) { // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest argument limit is Chrome, with 0x10000 args. @@ -640,7 +629,7 @@ function decodeCodePointsArray (array) { // If above that limit, decode using string concatenation // to avoid "call stack size exceeded". - return decodeLargeCodePointsArray(array) + return binarySlice(array, 0, array.length) } function utf8Slice (buf, start, end) { -- 2.34.1