Skip to content

Commit

Permalink
Minor: Avoid a clone in ArrayFunctionRewriter (apache#10204)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Apr 24, 2024
1 parent 0689515 commit 65ecfda
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions datafusion/functions-array/src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,8 @@ impl FunctionRewrite for ArrayFunctionRewriter {
expr,
field: GetFieldAccess::NamedStructField { name },
}) => {
let expr = *expr.clone();
let name = Expr::Literal(name);
Transformed::yes(get_field(expr, name.clone()))
Transformed::yes(get_field(*expr, name))
}

// expr[idx] ==> array_element(expr, idx)
Expand Down

0 comments on commit 65ecfda

Please sign in to comment.