From acaa58e60260225ac935b385d6cc799b446e8799 Mon Sep 17 00:00:00 2001 From: ZiJian Liu Date: Fri, 25 Dec 2020 22:22:33 +0800 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- lib/internal/http.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/internal/http.js b/lib/internal/http.js index 1d5973593e9ada..e2f083be6ebc06 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -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 };