Skip to content

Commit

Permalink
make use of flat_map
Browse files Browse the repository at this point in the history
  • Loading branch information
th7nder committed Jan 3, 2025
1 parent 8805012 commit 4a1df51
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions storage-provider/server/src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,12 @@ async fn submit_windowed_post(
}

let partitions = deadline_state.partitions.keys().cloned().collect();
let mut all_sectors = BTreeSet::new();
for (_, PartitionState { sectors }) in deadline_state.partitions {
all_sectors.extend(sectors);
}
let all_sectors = BTreeSet::from_iter(
deadline_state
.partitions
.into_iter()
.flat_map(|(_, PartitionState { sectors })| sectors),
);

if all_sectors.len() == 0 {
tracing::info!("Every sector expired... Nothing to prove here.");
Expand Down Expand Up @@ -724,7 +726,6 @@ async fn submit_windowed_post(
})
.collect::<Vec<_>>();


tracing::info!("Wait for block {} for open deadline", deadline.start,);
state
.xt_client
Expand Down

0 comments on commit 4a1df51

Please sign in to comment.