Skip to content

Commit f568384

Browse files
rayark1targos
authored andcommitted
fs: refactor handleTimestampsAndMode to remove redundant call
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]>
1 parent 82d8051 commit f568384

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

lib/internal/fs/cp/cp.js

-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ async function handleTimestampsAndMode(srcMode, src, dest) {
270270
// (through utimes call)
271271
if (fileIsNotWritable(srcMode)) {
272272
await makeFileWritable(dest, srcMode);
273-
return setDestTimestampsAndMode(srcMode, src, dest);
274273
}
275274
return setDestTimestampsAndMode(srcMode, src, dest);
276275
}

0 commit comments

Comments
 (0)