FrankChen021 commented on code in PR #5283:
URL: https://github.com/apache/calcite/pull/5283#discussion_r4115153339
##########
core/src/main/java/org/apache/calcite/rex/RexShuttle.java:
##########
@@ -163,15 +163,30 @@ protected RexNode[] visitArray(RexNode[] exprs, boolean
@Nullable [] update) {
*/
protected List<RexNode> visitList(
List<? extends RexNode> exprs, boolean @Nullable [] update) {
- ImmutableList.Builder<RexNode> clonedOperands = ImmutableList.builder();
+ ImmutableList.@Nullable Builder<RexNode> clonedOperands = null;
+ int i = 0;
for (RexNode operand : exprs) {
RexNode clonedOperand = operand.accept(this);
- if ((clonedOperand != operand) && (update != null)) {
- update[0] = true;
+ if (clonedOperand != operand && clonedOperands == null) {
+ clonedOperands = ImmutableList.builder();
Review Comment:
Calcite supports Guava 21, where `builderWithExpectedSize` is unavailable,
so I retained `ImmutableList.builder()`.
--
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]