findepi commented on code in PR #17442:
URL: https://github.com/apache/datafusion/pull/17442#discussion_r2330219757
##########
datafusion/physical-expr-common/src/sort_expr.rs:
##########
@@ -367,8 +367,21 @@ impl LexOrdering {
/// Creates a new [`LexOrdering`] from the given vector of sort
expressions.
/// If the vector is empty, returns `None`.
pub fn new(exprs: impl IntoIterator<Item = PhysicalSortExpr>) ->
Option<Self> {
- let (non_empty, ordering) = Self::construct(exprs);
- non_empty.then_some(ordering)
+ let exprs = exprs.into_iter();
Review Comment:
> I am not sure this is better / faster than what was previously used to
comute exprs and populate the hashset:
The goal of the second commit is to increase code coherence and reduce
logical duplication between `push` and `new`. Code maintainability >> micro
optimizations that potentially don't matter in grand scheme of things.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]