From 7495bcbf77349d708b249944a149c16f5ee0c667 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 2 Aug 2024 16:23:21 +0200 Subject: Revert "perf(ext/node): improve `Buffer` from string performance" (#24851) --- ext/node/polyfills/_brotli.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'ext/node/polyfills/_brotli.js') diff --git a/ext/node/polyfills/_brotli.js b/ext/node/polyfills/_brotli.js index ce5db3230..1524bf85c 100644 --- a/ext/node/polyfills/_brotli.js +++ b/ext/node/polyfills/_brotli.js @@ -9,10 +9,7 @@ const { TypedArrayPrototypeSlice, TypedArrayPrototypeSubarray, TypedArrayPrototypeGetByteLength, - TypedArrayPrototypeGetByteOffset, DataViewPrototypeGetBuffer, - DataViewPrototypeGetByteLength, - DataViewPrototypeGetByteOffset, TypedArrayPrototypeGetBuffer, } = primordials; const { isTypedArray, isDataView, close } = core; @@ -41,17 +38,9 @@ const toU8 = (input) => { } if (isTypedArray(input)) { - return new Uint8Array( - TypedArrayPrototypeGetBuffer(input), - TypedArrayPrototypeGetByteOffset(input), - TypedArrayPrototypeGetByteLength(input), - ); + return new Uint8Array(TypedArrayPrototypeGetBuffer(input)); } else if (isDataView(input)) { - return new Uint8Array( - DataViewPrototypeGetBuffer(input), - DataViewPrototypeGetByteOffset(input), - DataViewPrototypeGetByteLength(input), - ); + return new Uint8Array(DataViewPrototypeGetBuffer(input)); } return input; -- cgit v1.2.3