From d9814c06bfd4ecdb1192a0002e79e08c37a1e0b8 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Fri, 15 Jun 2018 11:59:28 +0200 Subject: [PATCH] Use string assignment operator instead of concat() The assignment operator is a lot faster. --- core/websock.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/websock.js b/core/websock.js index 0c52fd6d..8039fb80 100644 --- a/core/websock.js +++ b/core/websock.js @@ -105,7 +105,7 @@ Websock.prototype = { // Handle large arrays in steps to avoid long strings on the stack for (let i = 0; i < len; i += 4096) { 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; },