chesnokoff commented on code in PR #12337:
URL: https://github.com/apache/ignite/pull/12337#discussion_r2352655082
##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2QueryInfo.java:
##########
@@ -236,17 +236,8 @@ public boolean isSuspended() {
* @return SQL plan without the scanCount suffix.
*/
public String planWithoutScanCount(String plan) {
- String res = null;
-
- int start = plan.indexOf("\n /* scanCount");
-
- if (start != -1) {
- int end = plan.indexOf("*/", start);
-
- res = plan.substring(0, start) + plan.substring(end + 2);
- }
-
- return (res == null) ? plan : res;
+ return plan.replaceAll("[\\r\\n]+\\s*/\\* scanCount: [0-9]* \\*/", "")
+ .replaceAll("[\\r\\n]+\\s*/\\+\\+ scanCount: [0-9]* \\+\\+/", "");
Review Comment:
Regex meaning:
- \<new line\> \<whitespaces\> /* scanCount: \<number\> */
- \<new line\> \<whitespaces\> /++ scanCount: \<number\> ++/
We can combine these two regexes into one for better performance, but it
will make the code less readable
--
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]