From d858c9576af50b4573b7faa6577a9f2c63fd6b86 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 Backport-PR-URL: https://github.com/nodejs/node/pull/36890 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 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/internal/http.js b/lib/internal/http.js index 0065f93fd896f0..b17687d4d81624 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -5,20 +5,13 @@ const { Date, DatePrototypeGetMilliseconds, DatePrototypeToUTCString, - DatePrototypeValueOf, } = primordials; 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; @@ -26,13 +19,11 @@ function utcDate() { function cache() { const d = new Date(); - nowCache = DatePrototypeValueOf(d); utcCache = DatePrototypeToUTCString(d); setUnrefTimeout(resetCache, 1000 - DatePrototypeGetMilliseconds(d)); } function resetCache() { - nowCache = undefined; utcCache = undefined; } @@ -55,7 +46,6 @@ function emitStatistics(statistics) { module.exports = { kOutHeaders: Symbol('kOutHeaders'), kNeedDrain: Symbol('kNeedDrain'), - nowDate, utcDate, emitStatistics };