state_processing: nicer attestation swap

This commit is contained in:
Michael Sproul 2019-05-15 17:14:07 +10:00
parent e4bbcd333a
commit 137afa9131
No known key found for this signature in database
GPG Key ID: 77B1309D2E54E914

View File

@ -250,11 +250,8 @@ pub fn process_final_updates<T: EthSpec>(
}
// 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(())
}