summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_brotli.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-12-26 18:30:26 -0700
committerGitHub <noreply@github.com>2023-12-27 02:30:26 +0100
commit0efe438f7c191d8504355e03b27fe7e3055c9387 (patch)
treeb96fe9a897eb6941c87a95a04520662d26c02fbe /ext/node/polyfills/_brotli.js
parente33c5eb704c22fad69876e87d9b852a4e5072a7a (diff)
perf: remove opAsync (#21690)
`opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time.
Diffstat (limited to 'ext/node/polyfills/_brotli.js')
-rw-r--r--ext/node/polyfills/_brotli.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/node/polyfills/_brotli.js b/ext/node/polyfills/_brotli.js
index 6f77bb341..bf099759b 100644
--- a/ext/node/polyfills/_brotli.js
+++ b/ext/node/polyfills/_brotli.js
@@ -7,9 +7,11 @@ import { zlib as constants } from "ext:deno_node/internal_binding/constants.ts";
import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { Transform } from "node:stream";
import { Buffer } from "node:buffer";
-
const { core } = globalThis.__bootstrap;
const { ops } = core;
+const {
+ op_brotli_compress_async,
+} = core.ensureFastOps();
const enc = new TextEncoder();
const toU8 = (input) => {
@@ -119,7 +121,7 @@ export function brotliCompress(
}
const { quality, lgwin, mode } = oneOffCompressOptions(options);
- core.opAsync("op_brotli_compress_async", buf, quality, lgwin, mode)
+ op_brotli_compress_async(buf, quality, lgwin, mode)
.then((result) => callback(null, result))
.catch((err) => callback(err));
}