From 137afa91312e0b0f826ec54a537f97eca24c072c Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Wed, 15 May 2019 17:14:07 +1000 Subject: [PATCH] state_processing: nicer attestation swap --- eth2/state_processing/src/per_epoch_processing.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eth2/state_processing/src/per_epoch_processing.rs b/eth2/state_processing/src/per_epoch_processing.rs index 251dc3ec1..b8f459efd 100644 --- a/eth2/state_processing/src/per_epoch_processing.rs +++ b/eth2/state_processing/src/per_epoch_processing.rs @@ -250,11 +250,8 @@ pub fn process_final_updates( } // Rotate current/previous epoch attestations - std::mem::swap( - &mut state.previous_epoch_attestations, - &mut state.current_epoch_attestations, - ); - state.current_epoch_attestations = vec![]; + state.previous_epoch_attestations = + std::mem::replace(&mut state.current_epoch_attestations, vec![]); Ok(()) }