tanclary commented on code in PR #3460:
URL: https://github.com/apache/calcite/pull/3460#discussion_r1370652246
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -431,12 +438,41 @@ private static boolean checkPosOccurrenceParamValues(int
position,
throw
RESOURCE.invalidIntegerInputForRegexpFunctions(Integer.toString(occurrencePosition),
"occurrence_position", methodName).ex();
}
- if (position <= value.length()) {
+ if (position > value.length()) {
return false;
}
return true;
Review Comment:
Looking at the code smells, should we rewrite this as `return position <=
value.length()` (maybe I did my logic table wrong but hopefully you get what
I'm saying: Squash the `if` into a single return)
--
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]