Skip to content

Commit

Permalink
Avoid Collecting Driver Solutions in RunLoop (#1916)
Browse files Browse the repository at this point in the history
# Description

Follow up to #1914 

This PR just removes the unnecessary `collect` in the `flat_map`
closure.

## How to test

CI.
  • Loading branch information
Nicholas Rodrigues Lordello authored Oct 4, 2023
1 parent fb3ad9b commit 9b5ca1e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/autopilot/src/run_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ impl RunLoop {
.flat_map(|(index, response)| {
if response.solutions.is_empty() {
tracing::debug!(driver = ?self.drivers[index].url, "driver sent zero solutions");
return vec![];
}

response
.solutions
.into_iter()
.filter_map(|solution| {
.filter_map(move |solution| {
if solution.score == U256::zero() {
tracing::debug!(
id = ?solution.solution_id,
Expand All @@ -116,7 +115,6 @@ impl RunLoop {
Some((index, solution))
}
})
.collect_vec()
})
.collect_vec();

Expand Down

0 comments on commit 9b5ca1e

Please sign in to comment.