Skip to content

Commit

Permalink
avoid unwrap (#8956)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luv-Ray authored Jan 24, 2024
1 parent 78ca43c commit 2b84877
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datafusion/optimizer/src/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ impl Optimizer {

let new_inputs = result
.into_iter()
.enumerate()
.map(|(i, o)| match o {
.zip(inputs)
.map(|(new_plan, old_plan)| match new_plan {
Some(plan) => plan,
None => (*(inputs.get(i).unwrap())).clone(),
None => old_plan.clone(),
})
.collect::<Vec<_>>();

Expand Down

0 comments on commit 2b84877

Please sign in to comment.