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
+2
-2
@@ -276,12 +276,12 @@ inline void THROW_ERR_REQUIRE_ASYNC_MODULE(
|
||||
if (!parent_filename.IsEmpty() && parent_filename->IsString()) {
|
||||
Utf8Value utf8(env->isolate(), parent_filename);
|
||||
message += "\n From ";
|
||||
message += utf8.out();
|
||||
message += utf8.ToStringView();
|
||||
}
|
||||
if (!filename.IsEmpty() && filename->IsString()) {
|
||||
Utf8Value utf8(env->isolate(), filename);
|
||||
message += "\n Requiring ";
|
||||
message += +utf8.out();
|
||||
message += utf8.ToStringView();
|
||||
}
|
||||
THROW_ERR_REQUIRE_ASYNC_MODULE(env, message.c_str());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user