Skip to content

Commit 05d2158

Browse files
committed
CRC: remove extra clone and wait until end before cloning just once
Signed-off-by: Jacinta Ferrant <jacinta.ferrant@gmail.com>
1 parent 0d2b765 commit 05d2158

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stacks-signer/src/v0/signer_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ impl LocalStateMachine {
757757

758758
match signerdb.get_burn_block_by_ch(tenure_id) {
759759
Ok(block) => {
760-
potential_matches.push((block.block_height, miner_state.clone()));
760+
potential_matches.push((block.block_height, miner_state));
761761
}
762762
Err(e) => {
763763
warn!("Error retrieving burn block for consensus_hash {tenure_id} from signerdb: {e}");
@@ -767,7 +767,7 @@ impl LocalStateMachine {
767767

768768
potential_matches.sort_by_key(|(block_height, _)| *block_height);
769769

770-
let new_miner = potential_matches.last().map(|(_, miner)| miner.clone());
770+
let new_miner = potential_matches.last().map(|(_, miner)| (*miner).clone());
771771
if new_miner.is_none() {
772772
crate::monitoring::actions::increment_signer_agreement_state_conflict(
773773
crate::monitoring::SignerAgreementStateConflict::MinerView,

0 commit comments

Comments
 (0)