[ https://issues.apache.org/jira/browse/CASSANDRA-15033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
C. Scott Andreas reassigned CASSANDRA-15033: -------------------------------------------- Assignee: DaeMyung Kang > 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 > Assignee: 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-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org