From 463dfe64844f824125df7e05b28fbb61687125a3 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 27 Oct 2017 05:20:44 +0900 Subject: [PATCH] [js] use subarray to set array --- docs/demo/she.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/demo/she.js b/docs/demo/she.js index b44fc7f..41d8304 100644 --- a/docs/demo/she.js +++ b/docs/demo/she.js @@ -63,9 +63,10 @@ } } const copyToUint32Array = function(a, pos) { - for (let i = 0; i < a.length; i++) { - a[i] = mod.HEAP32[pos / 4 + i] - } + a.set(mod.HEAP32.subarray(pos / 4, pos / 4 + a.length)) +// for (let i = 0; i < a.length; i++) { +// a[i] = mod.HEAP32[pos / 4 + i] +// } } const copyFromUint32Array = function(pos, a) { for (let i = 0; i < a.length; i++) {