Skip to content

Commit

Permalink
http: remove dead code from internal/http.js
Browse files Browse the repository at this point in the history
PR-URL: nodejs#36630
Refs: nodejs#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>
  • Loading branch information
Lxxyx authored and Trott committed Dec 27, 2020
1 parent 4905501 commit acaa58e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/internal/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,20 @@ const {
const { setUnrefTimeout } = require('internal/timers');
const { PerformanceEntry, notify } = internalBinding('performance');

let nowCache;
let utcCache;

function nowDate() {
if (!nowCache) cache();
return nowCache;
}

function utcDate() {
if (!utcCache) cache();
return utcCache;
}

function cache() {
const d = new Date();
nowCache = d.valueOf();
utcCache = d.toUTCString();
setUnrefTimeout(resetCache, 1000 - d.getMilliseconds());
}

function resetCache() {
nowCache = undefined;
utcCache = undefined;
}

Expand All @@ -52,7 +44,6 @@ function emitStatistics(statistics) {
module.exports = {
kOutHeaders: Symbol('kOutHeaders'),
kNeedDrain: Symbol('kNeedDrain'),
nowDate,
utcDate,
emitStatistics
};

0 comments on commit acaa58e

Please sign in to comment.