AshinGau commented on code in PR #10213: URL: https://github.com/apache/doris/pull/10213#discussion_r900049077
########## fe/fe-core/src/main/java/org/apache/doris/common/PatternMatcher.java: ########## @@ -20,27 +20,58 @@ import com.google.common.base.Strings; import com.google.common.collect.Sets; +import java.util.Locale; import java.util.Set; import java.util.regex.Pattern; // Wrap for Java pattern and matcher public class PatternMatcher { + public static PatternMatcher MATCH_ANY = new PatternMatcher(Pattern.compile(".*")); private Pattern pattern; + private String casePattern; Review Comment: String.equals() is faster than Pattern.matcher().matches(), and we can avoid errors caused by special characters, such as '.', '\', '*', etc. Of course, these special characters will not appear in the name, but it is better to use the string equivalent comparison. -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org