diff options
| author | Matt Mastracci <matthew@mastracci.com> | 2023-03-17 16:15:27 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-17 22:15:27 +0000 |
| commit | 3487fde236d0852a8b0672c293fa41a741f471e8 (patch) | |
| tree | af466368147a08b787080446319a3a46a60ee37d /cli/ops/mod.rs | |
| parent | e55b448730160a6e4df9815a268d4049ac89deab (diff) | |
perf(core) Reduce copying and cloning in extension initialization (#18252)
Follow-up to #18210:
* we are passing the generated `cfg` object into the state function
rather than passing individual config fields
* reduce cloning dramatically by making the state_fn `FnOnce`
* `take` for `ExtensionBuilder` to avoid more unnecessary copies
* renamed `config` to `options`
Diffstat (limited to 'cli/ops/mod.rs')
| -rw-r--r-- | cli/ops/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/ops/mod.rs b/cli/ops/mod.rs index 562aa8649..c12409514 100644 --- a/cli/ops/mod.rs +++ b/cli/ops/mod.rs @@ -15,11 +15,11 @@ pub fn cli_exts(ps: ProcState) -> Vec<Extension> { deno_core::extension!(deno_cli, ops = [op_npm_process_state], - config = { + options = { ps: ProcState, }, - state = |state, ps| { - state.put(ps); + state = |state, options| { + state.put(options.ps); }, ); |
