diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-15 23:18:40 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-15 23:34:25 +0100 |
| commit | e087f61075814ae2612193f98a84c7f77101f90f (patch) | |
| tree | 839a00c658fb1bc3758d56c5e51731b844a1840c /compiler/rustc_query_system/src/query/caches.rs | |
| parent | 2d14db321b043ffc579a7461464c88d7e3f54f83 (diff) | |
| download | rust-e087f61075814ae2612193f98a84c7f77101f90f.tar.gz rust-e087f61075814ae2612193f98a84c7f77101f90f.zip | |
don't clone types that are copy
Diffstat (limited to 'compiler/rustc_query_system/src/query/caches.rs')
| -rw-r--r-- | compiler/rustc_query_system/src/query/caches.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_query_system/src/query/caches.rs b/compiler/rustc_query_system/src/query/caches.rs index c9dd75e4d55..81c7e4673d4 100644 --- a/compiler/rustc_query_system/src/query/caches.rs +++ b/compiler/rustc_query_system/src/query/caches.rs @@ -92,7 +92,7 @@ where let mut lock = self.cache.lock(); // We may be overwriting another value. This is all right, since the dep-graph // will check that the fingerprint matches. - lock.insert(key, (value.clone(), index)); + lock.insert(key, (value, index)); value } @@ -153,7 +153,7 @@ where #[inline] fn complete(&self, _key: (), value: V, index: DepNodeIndex) -> Self::Stored { - *self.cache.lock() = Some((value.clone(), index)); + *self.cache.lock() = Some((value, index)); value } @@ -283,7 +283,7 @@ where let mut lock = self.cache.get_shard_by_hash(key.index() as u64).lock(); #[cfg(not(parallel_compiler))] let mut lock = self.cache.lock(); - lock.insert(key, (value.clone(), index)); + lock.insert(key, (value, index)); value } |
