You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "DaeMyung Kang (JIRA)" <ji...@apache.org> on 2019/02/24 04:34:00 UTC
[jira] [Commented] (CASSANDRA-15033) Refactor to singleQuote reuse
java.util.regex.Pattern instead of String.replaceAll for
TableCQLHelper.java
[ https://issues.apache.org/jira/browse/CASSANDRA-15033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16776114#comment-16776114 ]
DaeMyung Kang commented on CASSANDRA-15033:
-------------------------------------------
Could someone give me a permission to assigne this issue for me?
> Refactor to singleQuote reuse java.util.regex.Pattern instead of String.replaceAll for TableCQLHelper.java
> ----------------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-15033
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15033
> Project: Cassandra
> Issue Type: Improvement
> Reporter: DaeMyung Kang
> Priority: Trivial
> Attachments: patch-15033.patch
>
>
> singleQuote uses `String.replaceAll ()` a lot in loop.
> and 'String.replaceAll()' compiles the regular expression each time it is called.
>
> {code:java}
> public String replaceAll(String regex, String replacement) {
> return Pattern.compile(regex).matcher(this).replaceAll(replacement);
> }{code}
>
> It is suggested in javadoc (https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#matches(java.lang.String,%20java.lang.CharSequence)) that it is efficient to reuse the pattern.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org