style: use clear over truncate(0) (#2338)

This commit is contained in:
Matthias Seitz
2023-04-21 14:19:23 +02:00
committed by GitHub
parent ec94783e96
commit 6d54baefdf
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ impl<DB: Database> Stage<DB> for SenderRecoveryStage {
rayon::spawn(move || {
let mut rlp_buf = Vec::with_capacity(128);
for entry in chunk {
rlp_buf.truncate(0);
rlp_buf.clear();
let _ = tx.send(recover(entry, &mut rlp_buf));
}
});

View File

@ -99,7 +99,7 @@ impl<DB: Database> Stage<DB> for TransactionLookupStage {
rayon::spawn(move || {
let mut rlp_buf = Vec::with_capacity(128);
for entry in chunk {
rlp_buf.truncate(0);
rlp_buf.clear();
let _ = tx.send(calculate_hash(entry, &mut rlp_buf));
}
});