Skip to content

Commit 9156f43

Browse files
Lxxyxdanielleadams
authored andcommitted
http: remove dead code from internal/http.js
PR-URL: #36630 Refs: #32329 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 8b7336b commit 9156f43

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lib/internal/http.js

+2-11
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,20 @@ const {
1111
const { setUnrefTimeout } = require('internal/timers');
1212
const { PerformanceEntry, notify } = internalBinding('performance');
1313

14-
let nowCache;
1514
let utcCache;
1615

17-
function nowDate() {
18-
if (!nowCache) cache();
19-
return nowCache;
20-
}
21-
2216
function utcDate() {
2317
if (!utcCache) cache();
2418
return utcCache;
2519
}
2620

2721
function cache() {
2822
const d = new Date();
29-
nowCache = DatePrototypeValueOf(d);
30-
utcCache = DatePrototypeToUTCString(d);
31-
setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d));
23+
utcCache = d.toUTCString();
24+
setUnrefTimeout(resetCache, 1000 - d.getMilliseconds());
3225
}
3326

3427
function resetCache() {
35-
nowCache = undefined;
3628
utcCache = undefined;
3729
}
3830

@@ -55,7 +47,6 @@ function emitStatistics(statistics) {
5547
module.exports = {
5648
kOutHeaders: Symbol('kOutHeaders'),
5749
kNeedDrain: Symbol('kNeedDrain'),
58-
nowDate,
5950
utcDate,
6051
emitStatistics
6152
};

0 commit comments

Comments
 (0)