alamb commented on code in PR #5640:
URL: https://github.com/apache/arrow-datafusion/pull/5640#discussion_r1141338823
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -632,16 +632,16 @@ impl LogicalPlan {
/// params_values
pub fn replace_params_with_values(
&self,
- param_values: &Vec<ScalarValue>,
+ param_values: &[ScalarValue],
) -> Result<LogicalPlan, DataFusionError> {
let exprs = self.expressions();
- let mut new_exprs = vec![];
+ let mut new_exprs = Vec::with_capacity(exprs.len());
for expr in exprs {
new_exprs.push(Self::replace_placeholders_with_values(expr,
param_values)?);
}
Review Comment:
I think you could make this slightly more idiomatic like this (untested):
```suggestion
let new_exprs = exprs
.into_iter()
.map(|expr| Self::replace_placeholders_with_values(expr,
param_values))
.collect::<Result<Vec<_>>()?;
```
Also, same thing below
--
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]