michaelbraun commented on code in PR #5262:
URL: https://github.com/apache/calcite/pull/5262#discussion_r4001864060


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java:
##########
@@ -1454,8 +1454,9 @@ private static Expression scaleValue(
     final Pair<RexNode, @Nullable Type> key = Pair.of(inputRef, 
currentStorageType);
     // If the RexInputRef has been visited under current storage type already,
     // it is not necessary to visit it again, just return the result.
-    if (rexWithStorageTypeResultMap.containsKey(key)) {
-      return rexWithStorageTypeResultMap.get(key);
+    final Result cached = rexWithStorageTypeResultMap.get(key);

Review Comment:
   In this case the values will always be non-null. Should I comment in these 
cases to make it more clear this is safe? 



-- 
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]

Reply via email to