Skip to content

Commit be0da14

Browse files
Apply suggestions from code review
Co-authored-by: Anna Henningsen <github@addaleax.net>
1 parent d95e989 commit be0da14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_file.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,7 +3449,8 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
34493449
bool verbatim_symlinks = args[5]->IsTrue();
34503450
bool preserve_timestamps = args[6]->IsTrue();
34513451

3452-
std::optional<std::function<bool(std::string, std::string)>> filter_fn;
3452+
std::optional<std::function<bool(std::string_view, std::string_view)>>
3453+
filter_fn;
34533454

34543455
if (args[7]->IsFunction()) {
34553456
Local<v8::Function> args_filter_fn = args[7].As<v8::Function>();
@@ -3516,8 +3517,7 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
35163517
auto dest_file_path = dest / dir_entry.path().filename();
35173518
auto dest_file_path_str = PathToString(dest_file_path);
35183519

3519-
if (filter_fn && !(*filter_fn)(dir_entry_path_str.c_str(),
3520-
dest_file_path_str.c_str())) {
3520+
if (filter_fn && !(*filter_fn)(dir_entry_path_str, dest_file_path_str)) {
35213521
continue;
35223522
}
35233523

0 commit comments

Comments
 (0)