mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: avoid unnecessary string -> char* -> string round trips
In these places we can just generate `std::string` directly, so there's no need to convert to an intermediate C string. PR-URL: https://github.com/nodejs/node/pull/60055 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
6 files changed
+10
-12
No files matched your search
@@ -284,10 +284,10 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
|
||||
options->allow_code_gen_wasm);
|
||||
|
||||
Utf8Value name_val(env->isolate(), options->name);
|
||||
ContextInfo info(*name_val);
|
||||
ContextInfo info(name_val.ToString());
|
||||
if (!options->origin.IsEmpty()) {
|
||||
Utf8Value origin_val(env->isolate(), options->origin);
|
||||
info.origin = *origin_val;
|
||||
info.origin = origin_val.ToString();
|
||||
}
|
||||
|
||||
ContextifyContext* result;
|
||||
|
||||
Reference in new issue
Block a user