http: remove dead code from internal/http.js

PR-URL: https://github.com/nodejs/node/pull/36630
Refs: https://github.com/nodejs/node/pull/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>
This commit is contained in:
ZiJian Liu authored and Rich Trott committed 2020-12-27 06:58:09 -08:00
1 parent 4905501741
commit acaa58e602
1 file changed
-9
-9
View File
@@ -8,14 +8,8 @@ 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;
@@ -23,13 +17,11 @@ function utcDate() {
function cache() {
const d = new Date();
nowCache = d.valueOf();
utcCache = d.toUTCString();
setUnrefTimeout(resetCache, 1000 - d.getMilliseconds());
}
function resetCache() {
nowCache = undefined;
utcCache = undefined;
}
@@ -52,7 +44,6 @@ function emitStatistics(statistics) {
module.exports = {
kOutHeaders: Symbol('kOutHeaders'),
kNeedDrain: Symbol('kNeedDrain'),
nowDate,
utcDate,
emitStatistics
};