mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
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: https://github.com/nodejs/node/pull/54369 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
1 parent
467ac3aec4
commit
fc08a9b0cd
1 file changed
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user