Skip to content

Commit d858c95

Browse files
Lxxyxdanielleadams
authored andcommitted
http: remove dead code from internal/http.js
PR-URL: #36630 Backport-PR-URL: #36890 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 7e3ad1b commit d858c95

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

lib/internal/http.js

-10
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,25 @@ const {
55
Date,
66
DatePrototypeGetMilliseconds,
77
DatePrototypeToUTCString,
8-
DatePrototypeValueOf,
98
} = primordials;
109

1110
const { setUnrefTimeout } = require('internal/timers');
1211
const { PerformanceEntry, notify } = internalBinding('performance');
1312

14-
let nowCache;
1513
let utcCache;
1614

17-
function nowDate() {
18-
if (!nowCache) cache();
19-
return nowCache;
20-
}
21-
2215
function utcDate() {
2316
if (!utcCache) cache();
2417
return utcCache;
2518
}
2619

2720
function cache() {
2821
const d = new Date();
29-
nowCache = DatePrototypeValueOf(d);
3022
utcCache = DatePrototypeToUTCString(d);
3123
setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d));
3224
}
3325

3426
function resetCache() {
35-
nowCache = undefined;
3627
utcCache = undefined;
3728
}
3829

@@ -55,7 +46,6 @@ function emitStatistics(statistics) {
5546
module.exports = {
5647
kOutHeaders: Symbol('kOutHeaders'),
5748
kNeedDrain: Symbol('kNeedDrain'),
58-
nowDate,
5949
utcDate,
6050
emitStatistics
6151
};

0 commit comments

Comments
 (0)