diff --git a/src/node_file.cc b/src/node_file.cc index 0dff5e84fcf1a0..e79c5dd8044d14 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -2132,7 +2132,7 @@ static void ReaddirRecursiveSync(const FunctionCallbackInfo& args) { full_path += ent.name; if (with_file_types) { - paths.push_back(current_path); + paths.push_back(std::move(current_path)); names.emplace_back(ent.name); types.push_back(static_cast(ent.type)); } else { @@ -2150,7 +2150,7 @@ static void ReaddirRecursiveSync(const FunctionCallbackInfo& args) { } #endif if (start_pos < full_path_length) { - relative_paths.emplace_back(full_path.substr(start_pos)); + relative_paths.emplace_back(std::move(full_path.substr(start_pos))); } } }