Skip to content

Commit 8163f31

Browse files
Lxxyxtargos
authored andcommitted
http: remove dead code from internal/http.js
PR-URL: #36630 Refs: #32329 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 6293aea commit 8163f31

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Diff for: lib/internal/http.js

-9
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,20 @@ const {
77
const { setUnrefTimeout } = require('internal/timers');
88
const { PerformanceEntry, notify } = internalBinding('performance');
99

10-
let nowCache;
1110
let utcCache;
1211

13-
function nowDate() {
14-
if (!nowCache) cache();
15-
return nowCache;
16-
}
17-
1812
function utcDate() {
1913
if (!utcCache) cache();
2014
return utcCache;
2115
}
2216

2317
function cache() {
2418
const d = new Date();
25-
nowCache = d.valueOf();
2619
utcCache = d.toUTCString();
2720
setUnrefTimeout(resetCache, 1000 - d.getMilliseconds());
2821
}
2922

3023
function resetCache() {
31-
nowCache = undefined;
3224
utcCache = undefined;
3325
}
3426

@@ -51,7 +43,6 @@ function emitStatistics(statistics) {
5143
module.exports = {
5244
kOutHeaders: Symbol('kOutHeaders'),
5345
kNeedDrain: Symbol('kNeedDrain'),
54-
nowDate,
5546
utcDate,
5647
emitStatistics
5748
};

0 commit comments

Comments
 (0)