diff options
author | Aleksey Kladov <[email protected]> | 2021-01-06 12:46:31 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-06 12:46:31 +0000 |
commit | 66ed821e18eadd3930a8621095c90b142763d517 (patch) | |
tree | 8fb1eb11fa56bf7d9669ef195c1baaa1e3eb2fdc /crates/rust-analyzer/src/reload.rs | |
parent | f7a15b5cd1df58e46066bbd27c90cb1ad7f9c316 (diff) |
Speed up snapshoting
Config can be fairly big, no need to deep clone it frequently
Diffstat (limited to 'crates/rust-analyzer/src/reload.rs')
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 51c24e966..76b50931a 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -18,7 +18,7 @@ use lsp_ext::StatusParams; | |||
18 | impl GlobalState { | 18 | impl GlobalState { |
19 | pub(crate) fn update_configuration(&mut self, config: Config) { | 19 | pub(crate) fn update_configuration(&mut self, config: Config) { |
20 | let _p = profile::span("GlobalState::update_configuration"); | 20 | let _p = profile::span("GlobalState::update_configuration"); |
21 | let old_config = mem::replace(&mut self.config, config); | 21 | let old_config = mem::replace(&mut self.config, Arc::new(config)); |
22 | if self.config.lru_capacity() != old_config.lru_capacity() { | 22 | if self.config.lru_capacity() != old_config.lru_capacity() { |
23 | self.analysis_host.update_lru_capacity(self.config.lru_capacity()); | 23 | self.analysis_host.update_lru_capacity(self.config.lru_capacity()); |
24 | } | 24 | } |