From 0e37dbe39bbbf0258d3c1da293adeb992007db03 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Sun, 16 Oct 2022 20:33:07 -0700 Subject: [PATCH] remove unnecessary clones (#28406) --- runtime/src/serde_snapshot/newer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/serde_snapshot/newer.rs b/runtime/src/serde_snapshot/newer.rs index 1f31a9424a9f64..4976bcb748d1fb 100644 --- a/runtime/src/serde_snapshot/newer.rs +++ b/runtime/src/serde_snapshot/newer.rs @@ -356,9 +356,9 @@ impl<'a> TypeContext<'a> for Context { let (bank_fields, mut accounts_db_fields) = Self::deserialize_bank_fields(stream_reader).unwrap(); accounts_db_fields.3.snapshot_hash = *accounts_hash; - let rhs = bank_fields; - let blockhash_queue = RwLock::new(rhs.blockhash_queue.clone()); - let hard_forks = RwLock::new(rhs.hard_forks.clone()); + let mut rhs = bank_fields; + let blockhash_queue = RwLock::new(std::mem::take(&mut rhs.blockhash_queue)); + let hard_forks = RwLock::new(std::mem::take(&mut rhs.hard_forks)); let lamports_per_signature = rhs.fee_rate_governor.lamports_per_signature; let epoch_accounts_hash = epoch_accounts_hash.or(rhs.epoch_accounts_hash.as_ref());