use faster string conversion

This commit is contained in:
Jörg Breitbart
2018-11-29 21:13:18 +01:00
parent 5d3ef759b4
commit 2483a98f63
+1 -5
View File
@@ -57,9 +57,5 @@ export function concat<T extends TypedArray>(a: T, b: T): T {
* the conversion will fail.
*/
export function utf16ToString<T extends TypedArray>(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);
}