Commit 362393ee3f2872872502bf114a164c7a7f702d46
remove duplicated code
MITSUNARI Shigeo committed on 12/11/2017, 10:43:37 AMParent: c0a8e75426a534dbbcb6686d286b000b566c9f59
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -334,13 +334,11 @@ | ||
334 | 334 … | } |
335 | 335 … | } |
336 | 336 … | |
337 | 337 … | function wrapDeserialize (func) { |
338 … | + func = wrapInput(func) | |
338 | 339 … | return function (p, buf) { |
339 | - const pos = mod._malloc(buf.length) | |
340 | - mod.HEAP8.set(buf, pos) | |
341 | - const r = func(p, pos, buf.length) | |
342 | - mod._free(pos) | |
340 … | + const r = func(p, buf) | |
343 | 341 … | if (r === 0) { |
344 | 342 … | throw new Error('Deserialize err') |
345 | 343 … | } |
346 | 344 … | } |
Built with git-ssb-web