mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: move encodingsMap to internal/util
PR-URL: https://github.com/nodejs/node/pull/51044 Refs: https://github.com/nodejs/performance/issues/136 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
This commit is contained in:
parent
6bb7c4d916
commit
4cae1b987e
3 changed files with 14 additions and 13 deletions
|
@ -85,6 +85,7 @@ const {
|
|||
normalizeEncoding,
|
||||
kIsEncodingSymbol,
|
||||
defineLazyProperties,
|
||||
encodingsMap,
|
||||
} = require('internal/util');
|
||||
const {
|
||||
isAnyArrayBuffer,
|
||||
|
@ -95,7 +96,6 @@ const {
|
|||
const {
|
||||
inspect: utilInspect,
|
||||
} = require('internal/util/inspect');
|
||||
const { encodings } = internalBinding('string_decoder');
|
||||
|
||||
const {
|
||||
codes: {
|
||||
|
@ -149,10 +149,6 @@ const constants = ObjectDefineProperties({}, {
|
|||
Buffer.poolSize = 8 * 1024;
|
||||
let poolSize, poolOffset, allocPool;
|
||||
|
||||
const encodingsMap = { __proto__: null };
|
||||
for (let i = 0; i < encodings.length; ++i)
|
||||
encodingsMap[encodings[i]] = i;
|
||||
|
||||
function createPool() {
|
||||
poolSize = Buffer.poolSize;
|
||||
allocPool = createUnsafeBuffer(poolSize).buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue