[js] use subarray to set array

dev
MITSUNARI Shigeo 7 years ago
parent e6cb8ab59c
commit 463dfe6484
  1. 7
      docs/demo/she.js

@ -63,9 +63,10 @@
} }
} }
const copyToUint32Array = function(a, pos) { const copyToUint32Array = function(a, pos) {
for (let i = 0; i < a.length; i++) { a.set(mod.HEAP32.subarray(pos / 4, pos / 4 + a.length))
a[i] = mod.HEAP32[pos / 4 + i] // for (let i = 0; i < a.length; i++) {
} // a[i] = mod.HEAP32[pos / 4 + i]
// }
} }
const copyFromUint32Array = function(pos, a) { const copyFromUint32Array = function(pos, a) {
for (let i = 0; i < a.length; i++) { for (let i = 0; i < a.length; i++) {

Loading…
Cancel
Save