From 2483a98f63eac5ced2bd42d4e93aaf01b669da1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Thu, 29 Nov 2018 21:13:18 +0100 Subject: [PATCH] use faster string conversion --- src/common/TypedArrayUtils.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common/TypedArrayUtils.ts b/src/common/TypedArrayUtils.ts index 8b540548..5d3bcb8a 100644 --- a/src/common/TypedArrayUtils.ts +++ b/src/common/TypedArrayUtils.ts @@ -57,9 +57,5 @@ export function concat(a: T, b: T): T { * the conversion will fail. */ export function utf16ToString(data: T): string { - let s = ''; - for (let i = 0; i < data.length; ++i) { - s += String.fromCharCode(data[i]); - } - return s; + return String.fromCharCode.apply(null, data); }