Skip to content

Commit

Permalink
fs: refactor handleTimestampsAndMode to remove redundant call
Browse files Browse the repository at this point in the history
Refactored the `handleTimestampsAndMode` function to eliminate the
redundant `setDestTimestampsAndMode` call. This simplifies the function
by ensuring that `setDestTimestampsAndMode` is only called once after
any necessary modifications to file writability.

PR-URL: #54369
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
  • Loading branch information
rayark1 authored and RafaelGSS committed Aug 30, 2024
1 parent 467ac3a commit fc08a9b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/internal/fs/cp/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ async function handleTimestampsAndMode(srcMode, src, dest) {
// (through utimes call)
if (fileIsNotWritable(srcMode)) {
await makeFileWritable(dest, srcMode);
return setDestTimestampsAndMode(srcMode, src, dest);
}
return setDestTimestampsAndMode(srcMode, src, dest);
}
Expand Down

0 comments on commit fc08a9b

Please sign in to comment.