mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Tighten up getStringFromWasm a bit
no need for some extra locals here
This commit is contained in:
parent
978b5ada63
commit
1ff9ccf072
@ -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));
|
||||
}}
|
||||
"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user