From 28c527c8f5855f4051cc02973a647741d20cb0fc Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sun, 3 Dec 2023 19:02:14 +0000 Subject: [PATCH] perf(lsp): fix redundant clones for ts responses (#21445) --- cli/lsp/tsc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 210ef701a5..072a881c3e 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -4443,8 +4443,7 @@ fn request( let state = op_state.borrow_mut::(); performance.measure(mark); - if let Some(response) = state.response.clone() { - state.response = None; + if let Some(response) = state.response.take() { Ok(response.data) } else { Err(custom_error(