From: Daniel Cousens Date: Sat, 15 Aug 2015 15:55:27 +0000 (+1000) Subject: avoid duplicate function X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=3d622d3c0bf330e332d6656db7aa3880adb52566;p=buffer.git avoid duplicate function --- 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) {