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 <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 8b7336b commit 9156f43

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎lib/internal/http.js‎

Lines changed: 2 additions & 11 deletions
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-
letnowCache;
1514
letutcCache;
1615

17-
functionnowDate(){
18-
if(!nowCache)cache();
19-
returnnowCache;
20-
}
21-
2216
functionutcDate(){
2317
if(!utcCache)cache();
2418
returnutcCache;
2519
}
2620

2721
functioncache(){
2822
constd=newDate();
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
functionresetCache(){
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)