Skip to content

Commit 62b5879

Browse files
LiviaMedeirosRafaelGSS
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 f125310 commit 62b5879

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
@@ -419,10 +419,10 @@ StatsBase.prototype.isSocket = function() {
419419
return this._checkModeProperty(S_IFSOCK);
420420
};
421421

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

0 commit comments

Comments
 (0)