soumyakanti3578 commented on code in PR #4567:
URL: https://github.com/apache/calcite/pull/4567#discussion_r2396175023
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -2331,17 +2331,20 @@ private void verify(RexNode before, RexNode simplified,
RexUnknownAs unknownAs)
private RexNode simplifySearch(RexCall call, RexUnknownAs unknownAs) {
assert call.getKind() == SqlKind.SEARCH;
- final RexNode a = simplify(call.getOperands().get(0), unknownAs);
+ final RexNode operand = call.getOperands().get(0);
+ final RexNode simplifiedOperand = simplify(operand, unknownAs);
+ final boolean operandUnchanged = operand.equals(simplifiedOperand);
Review Comment:
Hmm, I am not really sure if the same object will be returned when the
operand cannot be simplified any further. But I see that `RexCall.equals`
checks this in the beginning:
```
if (this == o) {
return true;
}
```
So I think call to `.equals` is safer and without being too inefficient.
But do let me know what your thoughts are regarding this.
--
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]