Skip to content

Commit

Permalink
[src/lib/execution_plan.rs] Improve logic for after_each task
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelMarks committed Aug 1, 2024
1 parent 2e826c0 commit 5f28cc4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/execution_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,14 @@ impl<'a> ExecutionPlanBuilder<'a> {
_steps.push(step.to_owned());
_steps
}));
if !interspersed_steps.is_empty() && has_after_each == 1 {
let after_each = after_and_before_each.first().unwrap().to_owned();
if interspersed_steps[interspersed_steps.len() - 1].name != after_each.name {
interspersed_steps.push(after_each);
if let Some(last_step) = interspersed_steps.last() {
if has_after_each == 1 {
let after_each = after_and_before_each.first().unwrap().to_owned();
if last_step.name != after_each.name
&& Some(&last_step.name) != Option::from(end_task_opt)
{
interspersed_steps.push(after_each);
}
}
}
Ok(Cow::Owned(interspersed_steps))
Expand Down

0 comments on commit 5f28cc4

Please sign in to comment.