From 1b7d03098396140a7fa89335e5d8dbb61d8d1586 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 30 Apr 2018 14:18:53 +0200 Subject: [PATCH] http2: reduce require calls in http2/core This commit removes unnecesary requires of http and internal/util in http2/core.js PR-URL: https://github.com/nodejs/node/pull/20422 Reviewed-By: Anatoli Papirovski Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- lib/internal/http2/core.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 5fa8e87ddbd04b..a42e416851af32 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -23,9 +23,12 @@ const { onServerStream, Http2ServerResponse, } = require('internal/http2/compat'); const { utcDate } = require('internal/http'); -const { promisify } = require('internal/util'); +const { + promisify, + customInspectSymbol: kInspect +} = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); -const { _connectionListener: httpConnectionListener } = require('http'); +const { _connectionListener: httpConnectionListener } = http; const { createPromise, promiseResolve } = process.binding('util'); const debug = util.debuglog('http2'); @@ -67,7 +70,6 @@ const { constants, nameForErrorCode } = binding; const NETServer = net.Server; const TLSServer = tls.Server; -const kInspect = require('internal/util').customInspectSymbol; const { kIncomingMessage } = require('_http_common'); const { kServerResponse } = require('_http_server');