Use string assignment operator instead of concat()

The assignment operator is a lot faster.
This commit is contained in:
Samuel Mannehed 2018-06-15 11:59:28 +02:00
parent 4318c8cafd
commit d9814c06bf
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ Websock.prototype = {
// Handle large arrays in steps to avoid long strings on the stack // Handle large arrays in steps to avoid long strings on the stack
for (let i = 0; i < len; i += 4096) { for (let i = 0; i < len; i += 4096) {
let part = arr.slice(i, Math.min(i + 4096, len)); let part = arr.slice(i, Math.min(i + 4096, len));
str = str.concat(String.fromCharCode.apply(null, part)); str += String.fromCharCode.apply(null, part);
} }
return str; return str;
}, },