Hotfix for double encodeInto call

This was a regression introduced in the last commit of https://github.com/rustwasm/wasm-bindgen/pull/1470, which might make Unicode strings 2x slower to pass.
This commit is contained in:
Ingvar Stepanyan 2019-05-14 14:14:34 +01:00
parent 15defcfd3a
commit 716ed0d891

View File

@ -1501,7 +1501,7 @@ impl<'a> Context<'a> {
const view = getUint8Memory().subarray(ptr + offset, ptr + size); const view = getUint8Memory().subarray(ptr + offset, ptr + size);
const ret = cachedTextEncoder.encodeInto(arg, view); const ret = cachedTextEncoder.encodeInto(arg, view);
{} {}
offset += cachedTextEncoder.encodeInto(arg, view).written; offset += ret.written;
}} }}
WASM_VECTOR_LEN = offset; WASM_VECTOR_LEN = offset;
return ptr; return ptr;