Skip to content

Commit 82313d3

Browse files
committed
chore: Apply PR comment from Aaron
1 parent 7e2d60e commit 82313d3

File tree

1 file changed

+3
-7
lines changed
  • stackslib/src/chainstate/stacks/tests

1 file changed

+3
-7
lines changed

stackslib/src/chainstate/stacks/tests/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,18 +521,14 @@ impl TestStacksNode {
521521
fork_tip: &BlockSnapshot,
522522
miner: &TestMiner,
523523
) -> Option<BlockSnapshot> {
524-
for commit_op in miner.block_commits.iter().rev() {
525-
if let Some(sn) = SortitionDB::get_block_snapshot_for_winning_stacks_block(
524+
miner.block_commits.iter().rev().find_map(|commit_op| {
525+
SortitionDB::get_block_snapshot_for_winning_stacks_block(
526526
ic,
527527
&fork_tip.sortition_id,
528528
&commit_op.block_header_hash,
529529
)
530530
.unwrap()
531-
{
532-
return Some(sn);
533-
}
534-
}
535-
return None;
531+
})
536532
}
537533

538534
pub fn get_miner_balance(clarity_tx: &mut ClarityTx, addr: &StacksAddress) -> u128 {

0 commit comments

Comments
 (0)