Skip to content

Commit c9e25e8

Browse files
fixup! src: move cpSync dir copy logic completely to C++
use std:string_view
1 parent 2ea5167 commit c9e25e8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/node_file.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,14 +3437,14 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
34373437
if (args[7]->IsFunction()) {
34383438
Local<v8::Function> args_filter_fn = args[7].As<v8::Function>();
34393439

3440-
filter_fn = [env, args_filter_fn](std::string src,
3441-
std::string dest) -> bool {
3440+
filter_fn = [env, args_filter_fn](std::string_view src,
3441+
std::string_view dest) -> bool {
34423442
Local<Value> argv[] = {
34433443
String::NewFromUtf8(
3444-
env->isolate(), src.c_str(), v8::NewStringType::kNormal)
3444+
env->isolate(), src.data(), v8::NewStringType::kNormal)
34453445
.ToLocalChecked(),
34463446
String::NewFromUtf8(
3447-
env->isolate(), dest.c_str(), v8::NewStringType::kNormal)
3447+
env->isolate(), dest.data(), v8::NewStringType::kNormal)
34483448
.ToLocalChecked()};
34493449
auto result =
34503450
args_filter_fn->Call(env->context(), Null(env->isolate()), 2, argv)

0 commit comments

Comments
 (0)