mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
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:
1 parent
4905501741
commit
acaa58e602
1 file changed
-9
@@ -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
|
||||
};
|
||||
Reference in new issue
Block a user