mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
perf(core): avoid extra alloc in Deno.core.encode() (#11323)
This commit is contained in:
parent
c76c09e335
commit
01cf8aab9f
1 changed files with 1 additions and 2 deletions
|
@ -655,9 +655,8 @@ fn encode(
|
|||
}
|
||||
};
|
||||
let text_str = text.to_rust_string_lossy(scope);
|
||||
let text_bytes = text_str.as_bytes().to_vec().into_boxed_slice();
|
||||
let zbuf: ZeroCopyBuf = text_str.into_bytes().into();
|
||||
|
||||
let zbuf: ZeroCopyBuf = text_bytes.into();
|
||||
rv.set(to_v8(scope, zbuf).unwrap())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue