diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-26 18:30:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 02:30:26 +0100 |
commit | 0efe438f7c191d8504355e03b27fe7e3055c9387 (patch) | |
tree | b96fe9a897eb6941c87a95a04520662d26c02fbe /ext/node/polyfills/internal/crypto/hkdf.ts | |
parent | e33c5eb704c22fad69876e87d9b852a4e5072a7a (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/internal/crypto/hkdf.ts')
-rw-r--r-- | ext/node/polyfills/internal/crypto/hkdf.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal/crypto/hkdf.ts b/ext/node/polyfills/internal/crypto/hkdf.ts index 4454b0488..8f3e8c7a9 100644 --- a/ext/node/polyfills/internal/crypto/hkdf.ts +++ b/ext/node/polyfills/internal/crypto/hkdf.ts @@ -33,6 +33,9 @@ import { const { core } = globalThis.__bootstrap; const { ops } = core; +const { + op_node_hkdf_async, +} = core.ensureFastOps(); const validateParameters = hideStackFrames((hash, key, salt, info, length) => { validateString(hash, "digest"); @@ -109,7 +112,7 @@ export function hkdf( validateFunction(callback, "callback"); - core.opAsync("op_node_hkdf_async", hash, key, salt, info, length) + op_node_hkdf_async(hash, key, salt, info, length) .then((okm) => callback(null, okm.buffer)) .catch((err) => callback(new ERR_CRYPTO_INVALID_DIGEST(err), undefined)); } |