Skip to content

Commit dedd9d1

Browse files
LiviaMedeirosaduh95
authored andcommitted
fs: avoid computing time coefficient constants in runtime
PR-URL: #58728 Fixes: #58726 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
1 parent ec60473 commit dedd9d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/fs/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ StatsBase.prototype.isSocket = function() {
421421
return this._checkModeProperty(S_IFSOCK);
422422
};
423423

424-
const kNsPerMsBigInt = 10n ** 6n;
425-
const kNsPerSecBigInt = 10n ** 9n;
426-
const kMsPerSec = 10 ** 3;
427-
const kNsPerMs = 10 ** 6;
424+
const kNsPerMsBigInt = 1_000_000n;
425+
const kNsPerSecBigInt = 1_000_000_000n;
426+
const kMsPerSec = 1_000;
427+
const kNsPerMs = 1_000_000;
428428
function msFromTimeSpec(sec, nsec) {
429429
return sec * kMsPerSec + nsec / kNsPerMs;
430430
}

0 commit comments

Comments
 (0)