Skip to content

Commit

Permalink
fixup! fs: improve error perf of sync *times
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk committed Sep 27, 2023
1 parent 8265a66 commit a491a51
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/internal/fs/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ function unlink(path) {
}

function utimes(path, atime, mtime) {
path = getValidatedPath(path);
return binding.utimesSync(pathModule.toNamespacedPath(path),
toUnixTimestamp(atime), toUnixTimestamp(mtime));
path = pathModule.toNamespacedPath(getValidatedPath(path));
return binding.utimesSync(path, toUnixTimestamp(atime), toUnixTimestamp(mtime));
}

function futimes(fd, atime, mtime) {
Expand All @@ -108,10 +107,8 @@ function futimes(fd, atime, mtime) {
}

function lutimes(path, atime, mtime) {
path = getValidatedPath(path);
return binding.lutimesSync(pathModule.toNamespacedPath(path),
toUnixTimestamp(atime),
toUnixTimestamp(mtime));
path = pathModule.toNamespacedPath(getValidatedPath(path));
return binding.lutimesSync(path, toUnixTimestamp(atime), toUnixTimestamp(mtime));
}

module.exports = {
Expand Down

0 comments on commit a491a51

Please sign in to comment.