summaryrefslogtreecommitdiff
path: root/cli/lsp/tsc.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-03-17 16:15:27 -0600
committerGitHub <noreply@github.com>2023-03-17 22:15:27 +0000
commit3487fde236d0852a8b0672c293fa41a741f471e8 (patch)
treeaf466368147a08b787080446319a3a46a60ee37d /cli/lsp/tsc.rs
parente55b448730160a6e4df9815a268d4049ac89deab (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/lsp/tsc.rs')
-rw-r--r--cli/lsp/tsc.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index 910d13691..91eb6e24b 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -2834,13 +2834,13 @@ deno_core::extension!(deno_tsc,
op_script_names,
op_script_version,
],
- config = {
+ options = {
performance: Arc<Performance>
},
- state = |state, performance| {
+ state = |state, options| {
state.put(State::new(
Arc::new(StateSnapshot::default()),
- performance,
+ options.performance,
));
},
);