Skip to content

Commit

Permalink
CRC: reduce needless vector creation
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <[email protected]>
  • Loading branch information
jferrant committed Jan 2, 2025
1 parent 7a140dc commit 14a3dab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions stackslib/src/burnchains/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ pub struct TestMinerFactory {
impl TestMiner {
pub fn new(
burnchain: &Burnchain,
privks: &[StacksPrivateKey],
privks: Vec<StacksPrivateKey>,
num_sigs: u16,
hash_mode: &AddressHashMode,
chain_id: u32,
) -> TestMiner {
TestMiner {
burnchain: burnchain.clone(),
privks: privks.to_vec(),
privks,
num_sigs,
hash_mode: hash_mode.clone(),
microblock_privks: vec![],
Expand Down Expand Up @@ -342,7 +342,7 @@ impl TestMinerFactory {
}

test_debug!("New miner: {:?} {}:{:?}", &hash_mode, num_sigs, &keys);
let mut m = TestMiner::new(burnchain, &keys, num_sigs, &hash_mode, self.chain_id);
let mut m = TestMiner::new(burnchain, keys, num_sigs, &hash_mode, self.chain_id);
m.id = self.next_miner_id;
self.next_miner_id += 1;
m
Expand Down
6 changes: 3 additions & 3 deletions stackslib/src/chainstate/stacks/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,13 @@ impl TestStacksNode {
burn_block: &mut TestBurnchainBlock,
miner: &mut TestMiner,
stacks_block: &StacksBlock,
microblocks: &[StacksMicroblock],
microblocks: Vec<StacksMicroblock>,
burn_amount: u64,
miner_key: &LeaderKeyRegisterOp,
parent_block_snapshot_opt: Option<&BlockSnapshot>,
) -> LeaderBlockCommitOp {
self.anchored_blocks.push(stacks_block.clone());
self.microblocks.push(microblocks.to_vec());
self.microblocks.push(microblocks);

test_debug!(
"Miner {}: Commit to stacks block {} (work {},{})",
Expand Down Expand Up @@ -704,7 +704,7 @@ impl TestStacksNode {
burn_block,
miner,
&stacks_block,
&microblocks,
microblocks.clone(),
burn_amount,
miner_key,
parent_block_snapshot_opt.as_ref(),
Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4323,7 +4323,7 @@ pub mod test {
&mut burn_block,
&mut self.miner,
&stacks_block,
&microblocks,
microblocks.clone(),
1000,
&last_key,
parent_sortition_opt.as_ref(),
Expand Down

0 comments on commit 14a3dab

Please sign in to comment.