diff options
author | Samuel Mannehed <samuel@cendio.se> | 2018-06-15 11:59:28 +0200 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2018-06-15 11:59:28 +0200 |
commit | d9814c06bfd4ecdb1192a0002e79e08c37a1e0b8 (patch) | |
tree | 18ec380fd24813c603636f79eb215b57d2bc0e91 /core/websock.js | |
parent | 4318c8cafd6d046ab7e50da5cd4396b8d89700d3 (diff) | |
download | novnc-d9814c06bfd4ecdb1192a0002e79e08c37a1e0b8.tar.gz |
Use string assignment operator instead of concat()
The assignment operator is a lot faster.
Diffstat (limited to 'core/websock.js')
-rw-r--r-- | core/websock.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/websock.js b/core/websock.js index 0c52fd6..8039fb8 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; }, |