Remove unnecessary clone of shred payload (#32540)

This commit is contained in:
steviez 2023-07-19 15:34:16 -05:00 committed by GitHub
parent c2ae30eb4d
commit d8516eea4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -129,12 +129,12 @@ where
if shred.payload() == &other_payload {
return Err(Error::InvalidDuplicateShreds);
}
let other_shred = Shred::new_from_serialized_shred(other_payload.clone())?;
let other_shred = Shred::new_from_serialized_shred(other_payload)?;
check_shreds(leader_schedule, &shred, &other_shred)?;
let (slot, shred_index, shred_type) = (shred.slot(), shred.index(), shred.shred_type());
let proof = DuplicateSlotProof {
shred1: shred.into_payload(),
shred2: other_payload,
shred2: other_shred.into_payload(),
};
let data = bincode::serialize(&proof)?;
let chunk_size = if DUPLICATE_SHRED_HEADER_SIZE < max_size {