From 8163f3179bdfbd7615f018f84a424f12a79f8bb8 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 aab4170a2f0e06..32ea2b5c1c09c5 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -7,14 +7,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; @@ -22,13 +16,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; } @@ -51,7 +43,6 @@ function emitStatistics(statistics) { module.exports = { kOutHeaders: Symbol('kOutHeaders'), kNeedDrain: Symbol('kNeedDrain'), - nowDate, utcDate, emitStatistics };