Skip to content

Commit

Permalink
optimizations: Optimize union steps
Browse files Browse the repository at this point in the history
  • Loading branch information
tontinton committed Dec 6, 2024
1 parent 3443539 commit 5a9ff8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/optimizations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ impl Optimizer {
}
}

// Don't forget to optimize union steps too!
steps
.into_iter()
.map(|mut step| {
if let WorkflowStep::Union(ref mut workflow) = step {
workflow.steps = self.optimize(workflow.steps.clone());
}
step
})
.collect()
}
}
2 changes: 1 addition & 1 deletion src/workflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub enum WorkflowStep {

#[derive(Debug, Clone)]
pub struct Workflow {
steps: Vec<WorkflowStep>,
pub steps: Vec<WorkflowStep>,
}

fn rx_stream(mut rx: mpsc::Receiver<Log>) -> LogStream {
Expand Down

0 comments on commit 5a9ff8e

Please sign in to comment.