Tighten up getStringFromWasm a bit

no need for some extra locals here
This commit is contained in:
Alex Crichton 2018-04-03 12:44:35 -07:00
parent 978b5ada63
commit 1ff9ccf072

View File

@ -697,10 +697,7 @@ impl<'a> Context<'a> {
self.expose_uint8_memory();
self.globals.push_str(&format!("
function getStringFromWasm(ptr, len) {{
const mem = getUint8Memory();
const slice = mem.slice(ptr, ptr + len);
const ret = textDecoder().decode(slice);
return ret;
return textDecoder().decode(getUint8Memory().slice(ptr, ptr + len));
}}
"));
}