Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use std::slice::from_ref to remove some clones #13518

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

jonahgao
Copy link
Member

Which issue does this PR close?

N/A

Rationale for this change

Replace &[T.clone()] with std::slice::from_ref(&T) to avoid cloning of T.

What changes are included in this PR?

Are these changes tested?

Yes. By existing tests.

Are there any user-facing changes?

No

@github-actions github-actions bot added sql SQL Planner physical-expr Physical Expressions core Core DataFusion crate labels Nov 21, 2024
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @jonahgao

@@ -1671,7 +1671,7 @@ impl DataFrame {
/// # }
/// ```
pub fn with_column(self, name: &str, expr: Expr) -> Result<DataFrame> {
let window_func_exprs = find_window_exprs(&[expr.clone()]);
let window_func_exprs = find_window_exprs(std::slice::from_ref(&expr));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonahgao
Copy link
Member Author

Thanks @comphead @alamb for the review.

@jonahgao jonahgao merged commit a53b974 into apache:main Nov 22, 2024
25 checks passed
@jonahgao jonahgao deleted the remove_clones branch November 22, 2024 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate physical-expr Physical Expressions sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants