mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 18:51:13 +08:00
perf: new_string_owned 零拷贝路径替代 new_string 二次克隆
This commit is contained in:
@@ -281,7 +281,7 @@ pub fn json_stringify<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
{
|
||||
return NativeResult::Err(crate::error::create_type_error(vm, "Converting circular structure to JSON"));
|
||||
};
|
||||
NativeResult::Ok(vm.new_string(&output))
|
||||
NativeResult::Ok(vm.new_string_owned(output))
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
||||
Reference in New Issue
Block a user