Skip to content

Commit

Permalink
use into_values() instead of into_iter() where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-toth committed Jun 16, 2024
1 parent 63c3370 commit 6b1d1e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datafusion/optimizer/src/common_subexpr_eliminate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ impl CommonSubexprEliminate {
.map(LogicalPlan::Aggregate)
} else {
let mut agg_exprs = common_exprs
.into_iter()
.map(|(_, (expr, expr_alias))| expr.alias(expr_alias))
.into_values()
.map(|(expr, expr_alias)| expr.alias(expr_alias))
.collect::<Vec<_>>();

let mut proj_exprs = vec![];
Expand Down Expand Up @@ -497,8 +497,8 @@ fn build_common_expr_project_plan(
) -> Result<LogicalPlan> {
let mut fields_set = BTreeSet::new();
let mut project_exprs = common_exprs
.into_iter()
.map(|(_, (expr, expr_alias))| {
.into_values()
.map(|(expr, expr_alias)| {
fields_set.insert(expr_alias.clone());
Ok(expr.alias(expr_alias))
})
Expand Down

0 comments on commit 6b1d1e3

Please sign in to comment.